mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 23:48:05 +03:00
Clear file finder's mini-editor between togglings
This commit is contained in:
parent
31163f1d8c
commit
b554318048
@ -23,12 +23,16 @@ describe 'FileFinder', ->
|
||||
rootView.trigger 'file-finder:toggle'
|
||||
expect(rootView.find('.file-finder')).toExist()
|
||||
expect(rootView.find('.file-finder input:focus')).toExist()
|
||||
finder.editor.insertText('this should not show up next time we toggle')
|
||||
|
||||
rootView.trigger 'file-finder:toggle'
|
||||
expect(editor1.isFocused).toBeFalsy()
|
||||
expect(editor2.isFocused).toBeTruthy()
|
||||
expect(rootView.find('.file-finder')).not.toExist()
|
||||
|
||||
rootView.trigger 'file-finder:toggle'
|
||||
expect(finder.editor.getText()).toBe ''
|
||||
|
||||
it "shows all relative file paths for the current project and selects the first", ->
|
||||
rootView.trigger 'file-finder:toggle'
|
||||
rootView.project.getFilePaths().done (paths) ->
|
||||
|
@ -27,7 +27,7 @@ class FileFinder extends View
|
||||
@on 'file-finder:select-file', => @select()
|
||||
|
||||
@editor.addClass 'single-line'
|
||||
@editor.buffer.on 'change', => @populatePathList()
|
||||
@editor.buffer.on 'change', => @populatePathList() if @hasParent()
|
||||
@editor.off 'move-up move-down'
|
||||
|
||||
toggle: ->
|
||||
@ -44,6 +44,7 @@ class FileFinder extends View
|
||||
detach: ->
|
||||
@rootView.focus()
|
||||
super
|
||||
@editor.setText('')
|
||||
|
||||
populatePathList: ->
|
||||
@pathList.empty()
|
||||
|
Loading…
Reference in New Issue
Block a user