diff --git a/src/app/command-panel.coffee b/src/app/command-panel.coffee index e7eb9d0f7..fe027b1f5 100644 --- a/src/app/command-panel.coffee +++ b/src/app/command-panel.coffee @@ -32,11 +32,11 @@ class CommandPanel extends View toggle: -> if @parent().length then @hide() else @show() - show: -> + show: (text='') -> @rootView.append(this) @prompt.css 'font', @editor.css('font') @editor.focus() - @editor.buffer.setText('') + @editor.buffer.setText(text) hide: -> @detach() diff --git a/src/app/root-view.coffee b/src/app/root-view.coffee index aacbd959b..afbd4e2e0 100644 --- a/src/app/root-view.coffee +++ b/src/app/root-view.coffee @@ -25,10 +25,8 @@ class RootView extends View @createProject(path) @on 'toggle-file-finder', => @toggleFileFinder() - @on 'show-console', -> window.showConsole() - @on 'find-in-file', => - @commandPanel.show() - @commandPanel.editor.setText("/") + @on 'show-console', => window.showConsole() + @on 'find-in-file', => @commandPanel.show("/") @one 'attach', => @focus() @on 'focus', (e) =>