Move find-in-file event and specs to command panel

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-04-12 14:55:47 -06:00
parent 877b4dc336
commit 3b7d7205f6
6 changed files with 11 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ class CommandPanel extends View
@rootView.on 'command-panel:toggle', => @toggle()
@rootView.on 'command-panel:execute', => @execute()
@rootView.on 'command-panel:find-in-file', => @show("/")
@rootView.on 'command-panel:repeat-relative-address', => @repeatRelativeAddress()
@editor.addClass 'single-line'

View File

@@ -6,4 +6,5 @@ window.keymap.bindKeys '.command-panel .editor',
enter: 'command-panel:execute'
window.keymap.bindKeys '.editor',
'meta-g': 'command-panel:repeat-relative-address'
'meta-g': 'command-panel:repeat-relative-address'
'meta-f': 'command-panel:find-in-file'

View File

@@ -2,7 +2,6 @@ window.keymap.bindKeys '*'
'meta-s': 'save'
'meta-w': 'close'
'alt-meta-i': 'show-console'
'meta-f': 'find-in-file'
window.keymap.bindKeys '.editor',
'meta-s': 'save'
@@ -32,4 +31,4 @@ window.keymap.bindKeys '.editor',
'meta-[': 'outdent-selected-rows'
'meta-]': 'indent-selected-rows'
'meta-{': 'show-previous-buffer'
'meta-}': 'show-next-buffer'
'meta-}': 'show-next-buffer'

View File

@@ -21,8 +21,6 @@ class RootView extends View
initialize: ({ pathToOpen, projectPath, panesViewState }) ->
@on 'toggle-file-finder', => @toggleFileFinder()
@on 'show-console', => window.showConsole()
@on 'find-in-file', => @commandPanel.show("/")
@one 'attach', => @focus()
@on 'focus', (e) =>
if @editors().length
@@ -36,7 +34,7 @@ class RootView extends View
else if pathToOpen?
@project = new Project(fs.directory(pathToOpen))
@open(pathToOpen) if fs.isFile(pathToOpen)
else if not panesViewState
else if not panesViewState?
@activeEditor().setBuffer(new Buffer)
@deserializePanes(panesViewState) if panesViewState