FileFinder is toggleable

This commit is contained in:
Corey Johnson & Nathan Sobo
2011-12-28 15:53:54 -08:00
parent d181ce1885
commit c6fbad8e9e
3 changed files with 20 additions and 8 deletions

View File

@@ -32,15 +32,19 @@ windowAdditions =
$(window).unbind('blur')
$(window).unbind('keydown')
findFile: ->
fileFinder = FileFinder.build(urls: [@editor.buffer.url])
window.layout.addPane(fileFinder)
fileFinder.input.focus()
toggleFileFinder: ->
if @fileFinder
@fileFinder.remove()
@fileFinder = null
else
@fileFinder = FileFinder.build(urls: [@editor.buffer.url])
window.layout.addPane(fileFinder)
fileFinder.input.focus()
bindKeys: ->
@bindKey 'meta+s', => @editor.save()
@bindKey 'meta+w', => @close()
@bindKey 'meta+t', => @findFile()
@bindKey 'meta+t', => @toggleFileFinder()
bindMenuItems: ->
@bindMenuItem "File > Save", "meta+s", => @editor.save()