       if @mode is 'visual' and operation instanceof Motions.Motion
         operation.execute = operation.select
 
-      @opStack.push(operation) if operation
+      @opStack.push(operation)
 
       # If we've received an operator in visual mode, mark the current
       # selection as the motion to operate on.

      'focus-pane-view-below': => new Panes.FocusPaneViewBelow()
      'focus-previous-pane-view': => new Panes.FocusPreviousPaneView()

  # Private: A helper to actually register the given Commands with the
  # editor.
  #
  # Commands - An object whose keys will be registered within the plugin's
  #            namespace and whose values are functions that returns the
  #            operation to push onto the stack or nothing at all.
  #
  # Returns nothing.
  handleCommands: (Commands) ->
    _.each Commands, (fn, commandName) =>
      eventName = "vim-mode:#{commandName}"
      @editorView.command eventName, (event) => @pushOperations(fn(event))

  # Private: Attempts to prevent the cursor from selecting the newline
  # while in command mode.

  #
  # Returns nothing.
  setupCommandMode: ->
    @registerCommands
      'search': => @currentSearch = new Motions.Search(@editorView, @)
      'reverse-search': => @currentSearch = (new Motions.Search(@editorView, @)).reversed()
      'replace': => @currentReplace = new Operators.Replace(@editorView, @)
      'activate-command-mode': => @activateCommandMode()
      'activate-insert-mode': => @activateInsertMode()
      'activate-linewise-visual-mode': => @activateVisualMode('linewise')
      'activate-characterwise-visual-mode': => @activateVisualMode('characterwise')
      'activate-blockwise-visual-mode': => @activateVisualMode('blockwise')
      'reset-command-mode': => @resetCommandMode()
      'repeat-prefix': (e) => @repeatPrefix(e)

    @registerOperationCommands
      'substitute': => new Commands.Substitute(@editor, @)
      'substitute-line': => new Commands.SubstituteLine(@editor, @)
      'insert-after': => new Commands.InsertAfter(@editor, @)
