adobe/brackets — pull request #2026 by gruehle (2012-11-02 00:20:07+00:00)
Title: Fixes for focus handling

@peterflynn

This pull request has a couple key changes to the way focus is handled and managed.

* `EditorManager.focusEditor()` now returns focus to the last visible
editor that had focus. We no longer force the focus back to the
main editor after saving or cancelling an open.

* Add `EditorManager.getActiveEditor()`. This function is similar to
`getFocusedEditor()`, but will return the last editor that was given
focus, even if it doesn't have focus at the moment. This is useful
for commands like Find/Find Next that should work on the active
document even if the Find dialog has focus.

* Update FindReplace, FindInFiles and QuickOpen to use `getActiveEditor()`

I tested the changes in the following scenarios:

* File Save - If focus is in an inline editor, focus is returned to the editor after saving (logged as issue #547)
* File Open - if the open is cancelled, focus is not forced to the main editor
* Changing indent size - focus is returned to the editor that previously had focus
* Find/Replace - Cmd-G works while the find dialog is open (issue #1935)