mirror of
https://github.com/atom/atom.git
synced 2026-02-10 06:35:00 -05:00
implement meta-f on root-view
This commit is contained in:
@@ -24,15 +24,18 @@ class CommandPanel extends View
|
||||
@commandInterpreter = new CommandInterpreter()
|
||||
|
||||
toggle: ->
|
||||
if @parent().length
|
||||
@detach()
|
||||
@rootView.activeEditor().focus()
|
||||
else
|
||||
@rootView.append(this)
|
||||
@prompt.css 'font', @editor.css('font')
|
||||
@editor.focus()
|
||||
@editor.buffer.setText('')
|
||||
if @parent().length then @hide() else @show()
|
||||
|
||||
show: ->
|
||||
@rootView.append(this)
|
||||
@prompt.css 'font', @editor.css('font')
|
||||
@editor.focus()
|
||||
@editor.buffer.setText('')
|
||||
|
||||
hide: ->
|
||||
@detach()
|
||||
@rootView.activeEditor().focus()
|
||||
|
||||
execute: ->
|
||||
@commandInterpreter.eval(@rootView.activeEditor(), @editor.getText())
|
||||
@toggle()
|
||||
@hide()
|
||||
@@ -28,9 +28,13 @@ class RootView extends View
|
||||
'meta-t': 'toggle-file-finder'
|
||||
'meta-:': 'command-panel:toggle'
|
||||
'alt-meta-i': 'show-console'
|
||||
'meta-f': 'find-in-file'
|
||||
|
||||
@on 'toggle-file-finder', => @toggleFileFinder()
|
||||
@on 'show-console', -> window.showConsole()
|
||||
@on 'find-in-file', =>
|
||||
@commandPanel.show()
|
||||
@commandPanel.editor.setText("/")
|
||||
|
||||
@one 'attach', => @focus()
|
||||
@on 'focus', (e) =>
|
||||
|
||||
Reference in New Issue
Block a user