Sublime Forum

Sublime text 2 search does not work

#1

I have ST2 installed on Win7x64 and for some reason the global ‘Find in Files’ (ctrl+shift+f) stopped working (it worked before). Now all i get is :

[quote]Searching 0 files for “capbSectionac”

0 matches across 0 files[/quote]

The regular search in the currently opened file is working correctly.

I tried re-installing both the 32 and the 64 version it but to no avail :frowning:

Anyone encountered it? Any solution?

0 Likes

#2

What does your “Where:” field say? Obviously it’s searching 0 files.

0 Likes

#3

Here’s what I have found. I use two text editors simultaneously and usually this does not cause problems, but it seems to periodically in the find in files case.

I used my second text editor to global replace Log with AutoLog in a few *.py files, then saved the changes, then switched to ST2 which had an open view onto one of the changed py files, and ST2 did correctly show the AutoLog change (i.e. ST2 had detected the external edit and reloaded the py source). Then I did a search in files (ctrl+shift+F) for AutoLog in *.py and ST2 failed to find AutoLog. I repeated the find a couple of times and it failed each time. Then I made an unrelated edit using ST2 to one of the relevant py files and saved it, then repeated the find in files and only then did ST2 find AutoLog.

BTW in response to:

When ST2 says “0 matches across 0 files”, “0 files” is not referring to the number of files that ST2 searched in, it refers to the number of files that contain matches. So this is going to be zero if no matches were found.

0 Likes

#4

Right, but it also said:

which is why I was curious :smile:

0 Likes

#5

You’re right, good point.

0 Likes

#6

I have been able to repro this problem a few times. Sublime is definitely searching some kind of cached version of source files, even while it is showing on-screen the latest, up to date copy of the source files. Makes ‘find in files’ really problematic because you can’t rely on it.

0 Likes

#7

I have this problem right now - exactly as described by the OP. (In a project)

I’ve tried Command-Shift-F, mouse commands, case sensitive on and off, whole word etc.

It just does nothing.

0 Likes

#8

I just tried it again with “Use Buffer” active and it worked.

0 Likes

#9

In the second field “Where:”, make sure you don’t a folder selected. If it has the placeholder text “Open files and folders” it should search the whole project. Otherwise it will just search the folder selected which is most likely why it is coming up with 0 results in 0 files.

That was the case for me anyways.

0 Likes

#10

I am facing this problem.

Suddenly Sublime Text 2 Search in files stopped working.

The steps above doesn’t work for me, I have to use Notepad++ to search in files and then return to ST2, this is very annoying. Do you have another suggestion.

Thanks in advance and best Regards.!!

0 Likes

#11

For me the issue came up with complex application logs.

The problem was caused by certain log entries that contained mystery characters that were displayed in the open file as white-on-black “NUL”. ST2 was interpreting these files as binary and excluding them from Find All operations, even though once opened ST2 could search within such files normally.

The only way I found out was to search those files with ST3 which at least lists each searched file and shows “binary” in angle brackets where the per-file search results should appear. Real PITA but helped me start transitioning to ST3.

0 Likes

#12

Mine just stopped working as well when using ‘Find in Files’ (cmd+shift+f).

I got it to work again by clearing the ‘Where:’ field using the ‘clear’ option.

0 Likes