Focus the active editor when the file finder is closed

This commit is contained in:
Nathan Sobo
2012-04-12 15:56:41 -06:00
parent 8513e60903
commit d776755348
3 changed files with 5 additions and 2 deletions

View File

@@ -394,11 +394,11 @@ describe "RootView", ->
expect(editor1.buffer.path).not.toBe expectedPath
expect(editor2.buffer.path).not.toBe expectedPath
# debugger
rootView.fileFinder.trigger 'file-finder:select-file'
expect(editor1.buffer.path).not.toBe expectedPath
expect(editor2.buffer.path).toBe expectedPath
expect(editor2.isFocused).toBeTruthy()
describe "keymap wiring", ->
commandHandler = null

View File

@@ -71,3 +71,7 @@ class FileFinder extends View
paths = (pathAndScore.path for pathAndScore in scoredPaths when pathAndScore.score > 0)
paths.slice 0, @maxResults
remove: ->
$('#panes .editor.active').focus()
super

View File

@@ -185,7 +185,6 @@ class RootView extends View
if @fileFinder and @fileFinder.parent()[0]
@fileFinder.remove()
@fileFinder = null
@activeEditor().focus()
else
@project.getFilePaths().done (paths) =>
relativePaths = (path.replace(@project.path, "") for path in paths)