+1 for a "enable/disable file preview" option on Global settings.Also check the binary files would be awesome, open a binary file in a text editor does not make much sense.. Display a warning message is a better solution, something like "The file appears to be a Binary file, open anyway?"

Thanks for this tito. I have been working to figure out how to detect preview reliably, I didn't realize that that the preview file_name wasn't found in the views returned by window.views(). It appears this is only the case on the first activation though (so preview is only detectable on the first raised event), but it is useful enough that I can at least identify a preview and then I can timeout. It doesn't completely solve my issue of running code on a preview window during the "Go To Anything" panel, but I can at least identify the preview and delay the code to minimize the annoyance.

**Edit: ** It looks like it does work fine after subsequent activations (or at least in the context I am using it), either way, thanks again. I personally don't mind the previews, but I found how you determined a preview very useful.