Find Only In Selection when there's no selection


#1

When no text is selected, the ‘Only In Selection’ button isn’t disabled (and it should be); activating it will result in no matches.

This wouldn’t be much of a problem per se, but the panel remembers my last choice, so if I first select some text and search in selection, next time I search (with no selected text), I won’t find what I look for.

This means that I have to explicitly enable or disable the ‘Only In Selection’ key each time I search for text.

A more sensible approach would be one of the two:

  • ‘Only in Selection’ is automatically selected if the current selection is not empty AND I did click on it some time in the past (that is: I didn’t disable it when there was a non-empty selection), or:

  • ‘Only in Selection’ is automatically selected if the current selection is not empty AND I did set some preference.

The latter, which happens to be what Sublime Text does, would very probably make more sense.


#2

I like your idea! Can you open an issue for it on https://github.com/atom/find-and-replace.


#3

Done: #173.