From cdc4da2f7d6f0e04cd0de8fd0ffeee6f7db2b3eb Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Tue, 10 Apr 2012 17:05:45 -0700 Subject: [PATCH] :lipstick: (this was added so the function could be one line instead of two) --- src/app/command-panel.coffee | 4 ++-- src/app/root-view.coffee | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) 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) =>