adobe/brackets — pull request #2282 by gruehle (2012-12-05 19:39:41+00:00)
Title: Refine find logic with pre-selected query string

@peterflynn

Fix for issue #2104

This does slightly change the "find" functionality, but it should be more consistent now.

* Closing the find bar with the enter key should *always* return focus to the editor and select the currently highlighted item
* If you have an initial selection when the Find dialog is opened, the *next* occurrence is highlighted

Here are the various scenarios I tested:

1. No text selected, open find, enter string, hit return. The first occurrence of the query string is selected.
2. No text selected, open find, enter string, hit Cmd-G to highlight the next occurrence, hit return. The second (highlighted) occurrence is selected.
3. Text selected, open find. The *next* occurrence of the selected string is highlighted. Hit return to close the dialog and select the highlighted text.
4. Text selected, open find. The *next* occurrence is highlighted. Press Cmd-G to highlight the *following* occurrence. Hit return the close the dialog and select the highlighted text.