   @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

    @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()

  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)

  hide: ->
    @detach()
    @rootView.activeEditor().focus()

  execute: (command = @editor.getText()) ->
    try
      @commandInterpreter.eval(@rootView.activeEditor(), command)
    catch error

  navigateBackwardInHistory: ->
    return if @historyIndex == 0
    @historyIndex--
    @miniEditor.setText(@history[@historyIndex])

  navigateForwardInHistory: ->
    return if @historyIndex == @history.length
    @historyIndex++
    @miniEditor.setText(@history[@historyIndex] or '')

  repeatRelativeAddress: ->
    @commandInterpreter.repeatRelativeAddress(@rootView.activeEditor())
