Sublime Forum

"Find" usability issues

#1

I’m new to Sublime Text 2, and I love it. I look forward to seeing this product evolve because I think it’s a great foundation for an incredible product.

As far as usability is concerned, there are some UI differences from other IDEs that are cool, and some that are a little funky. Specific to Find and Find In Files, I feel like this is an area that can be improved. I’m having consistent problems with Find in local files and I’m getting to the point where I don’t trust it anymore. I’m not sure exactly what I’m doing that’s wrong, but I often get into a state where Find isn’t finding results that I know exist in the file. Sometimes this gets resolved by clicking around in the file, and hitting CTL-F again. Again, I’m not sure exactly what I’m doing to create these situations.

I recently discovered the “Find In Selection” button, which has been the culprit when nothing is selected. To me, this button should do nothing when there is no selection. In this case, the button should either auto turn off, or Find should function normally… not sure if everyone would agree with that, but it’s weird when Find does nothing when the match is directly below your cursor and nothing is selected.

Also, Find In Files can be improved… For example, I can’t find anything that toggles whether or not to search subfolders. Sometimes I just want to search a folder… and sometimes I want to search my entire project. I think it always searches subfolders, but I’m not sure. There’s also no progress indicator, so I have no idea how long the process is going to take, and when it’s completed.

Just some thoughts…

0 Likes

#2

All good points, though I have never seen the issue where known strings aren’t found using Sublime’s find functions. If you have seen that behaviour and can repeat it, a bug report would be useful as I’d consider that to be worth escalating.

Some of the issues you describe could be platform specific since I’ve heard that Mac users are getting some issues with Find not populating the selection and/or find in selection misbehaving, but I’ve not seen these issues on Windows or Linux.

Regarding find in selection. The state of the toggle is determined by the selection; if it spans >1 line, find in selection is automatically enabled, if it’s <1 line, the selection is automatically placed into the find field and find in selection is disabled. Personally I find this intuitive, but I’d prefer optional instead of automatic behaviour; for find in selection to remember its setting and just be ignored when there’s no selection for example.

Sublime’s find in selection functionality behaves in a slightly funky way and could use some improvement:

  1. Sublime doesn’t have the notion of “cancelling” a search which, in this case, should return the selection state to the original selection. Ctrl+u can be used to get your selection back if you need it though.
  2. As you start a search, the selection becomes that which matches a found string, or no selection if nothing is found. The original selection disappears although the search function still remembers the original selection’s bounds, so for example searching for “the”, then backspacing, then “for”; in both cases the search is within selection, but you won’t see the selection for the second search. Visually, this is counter-intuitive.

A neat way to use Find is to select something and hit ctrl+e. This manually populates find with the selected text. You can then hit F3 or Shift+F3 to search forwards and back without using the find panel at all.

Find should also have a “global/all” button/function which will search from the file start regardless of the caret position.

S

0 Likes

#3

One possible explanation: if you have a file open, then Sublime will search the file that’s in memory rather than the file on disk. So if you’ve modified a file outside of Sublime Text, then do a Find in Files, it might miss something that you’ve added. The solution, as you said, is to activate the file in question, which will cause ST to reload its contents and make the search work.
Alternatively, if you’ve got a project, you could do a Close All, because if no files are open then ST will just search the disk contents. This second workaround may be less desirable, however, because it wipes your undo history.

0 Likes

#4

Isn’t it easier to just go home before Finding? (if your keyboard doesn’t have a Home key then Fn + Left Arrow or Control + G 0 could work)

Doesn’t seem right to use one keybinding to save one but, if you still want to, it’s easy enough to add your own binding. Here’s how to run multiple commands: Run Multiple Commands.. Command. The commands are scroll_to_bof and show_panel {“panel”: “find”}

0 Likes