Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 unable to find text that is plainly there

Hitting cmd+f to find text in SublimeText, I frequently see something like:

enter image description here

Clearly 'someText' exists on the page. Why can't Sublime find it?

Note this sometimes seems to work, and sometimes fails. I can't work out the difference though.

How can I reliably find text with Sublime Text?

like image 484
mikemaccana Avatar asked Oct 27 '14 17:10

mikemaccana


3 Answers

I've tried to reproduce this problem with Sublime Text 2 and this is what I found:

  • If you place caret before the text and the hit find, the text will be found
  • If you place the caret after the text and then hit find, the text will not be found

It seems that Sublime Text doesn't wrap search by default. You can enable it by toggling the button with the arrow icon (second one from the left of Find what, its tooltip should say Wrap). Then the search works regardless of the caret position.

like image 82
Bohuslav Burghardt Avatar answered Dec 12 '22 04:12

Bohuslav Burghardt


Look at the buttons right before search box. Sometimes they are just get disabled accidentally, mis-click, or the short-cut get trigged, then the search doesn't behave as expected.

From left to right, RegExp, case sensitive, whole word, wrap(search whole doc, not just below current line), you can see them with mouse pointer hover.

I strongly suggest you to disable those shortcuts to prevent unexpected toggle of these :)

like image 24
Hong Lin Avatar answered Dec 12 '22 05:12

Hong Lin


Also, turning off the regex may help you in searching for symbols which have special meaning in regex. For instance, someText(foo) will not be searchable in regex mode without escaping the brackets or putting the search string in quotes.

like image 25
Palash Goel Avatar answered Dec 12 '22 05:12

Palash Goel