mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Fix bug: file finder correctly focuses editor after opening a file.
This commit is contained in:
parent
9079bcb103
commit
abc230eee3
@ -133,13 +133,14 @@ describe 'FileFinder', ->
|
||||
[editor1, editor2] = []
|
||||
|
||||
beforeEach ->
|
||||
rootView.find('.editor').trigger 'split-right'
|
||||
[editor1, editor2] = rootView.find('.editor').map -> $(this).view()
|
||||
|
||||
rootView.attachToDom()
|
||||
editor1 = rootView.activeEditor()
|
||||
editor2 = editor1.splitRight()
|
||||
expect(rootView.activeEditor()).toBe editor2
|
||||
rootView.trigger 'file-finder:toggle'
|
||||
|
||||
describe "when there is a path selected", ->
|
||||
it "opens the file associated with that path in the editor", ->
|
||||
fit "opens the file associated with that path in the editor", ->
|
||||
finder.trigger 'move-down'
|
||||
selectedLi = finder.find('li:eq(1)')
|
||||
|
||||
|
@ -27,7 +27,6 @@ class FileFinder extends View
|
||||
@on 'move-down', => @moveDown()
|
||||
@on 'file-finder:select-file', => @select()
|
||||
|
||||
@miniEditor.on 'focusout', => @detach()
|
||||
@miniEditor.buffer.on 'change', => @populatePathList() if @hasParent()
|
||||
@miniEditor.off 'move-up move-down'
|
||||
|
||||
@ -41,8 +40,11 @@ class FileFinder extends View
|
||||
@rootView.project.getFilePaths().done (@paths) => @populatePathList()
|
||||
@rootView.append(this)
|
||||
@miniEditor.focus()
|
||||
@miniEditor.on 'focusout', => @detach()
|
||||
|
||||
detach: ->
|
||||
console.log "in detach, focusing root view"
|
||||
@miniEditor.off 'focusout'
|
||||
@rootView.focus()
|
||||
super
|
||||
@miniEditor.setText('')
|
||||
|
Loading…
Reference in New Issue
Block a user