Rename @editor to @miniEditor in command panel

This commit is contained in:
Corey Johnson
2012-06-13 16:29:44 -07:00
parent 9c748d14c3
commit f11aaa2d22

View File

@@ -24,7 +24,7 @@ class CommandPanel extends View
@content: ->
@div class: 'command-panel', =>
@div ':', class: 'prompt', outlet: 'prompt'
@subview 'editor', new Editor(mini: true)
@subview 'miniEditor', new Editor(mini: true)
commandInterpreter: null
history: null
@@ -39,24 +39,24 @@ class CommandPanel extends View
@rootView.on 'command-panel:find-in-file', => @show("/")
@rootView.on 'command-panel:repeat-relative-address', => @repeatRelativeAddress()
@editor.off 'move-up move-down'
@editor.on 'move-up', => @navigateBackwardInHistory()
@editor.on 'move-down', => @navigateForwardInHistory()
@miniEditor.off 'move-up move-down'
@miniEditor.on 'move-up', => @navigateBackwardInHistory()
@miniEditor.on 'move-down', => @navigateForwardInHistory()
toggle: ->
if @parent().length then @hide() else @show()
show: (text='') ->
@rootView.append(this)
@prompt.css 'font', @editor.css('font')
@editor.focus()
@editor.buffer.setText(text)
@prompt.css 'font', @miniEditor.css('font')
@miniEditor.focus()
@miniEditor.buffer.setText(text)
hide: ->
@detach()
@rootView.activeEditor().focus()
execute: (command = @editor.getText()) ->
execute: (command = @miniEditor.getText()) ->
try
@commandInterpreter.eval(@rootView.activeEditor(), command)
catch error
@@ -73,12 +73,12 @@ class CommandPanel extends View
navigateBackwardInHistory: ->
return if @historyIndex == 0
@historyIndex--
@editor.setText(@history[@historyIndex])
@miniEditor.setText(@history[@historyIndex])
navigateForwardInHistory: ->
return if @historyIndex == @history.length
@historyIndex++
@editor.setText(@history[@historyIndex] or '')
@miniEditor.setText(@history[@historyIndex] or '')
repeatRelativeAddress: ->
@commandInterpreter.repeatRelativeAddress(@rootView.activeEditor())