     else if direction == 'auto'
       @editor.autoIndentSelectedRows()
 
-    @editor.setCursorScreenPosition([row, 0])
-    @editor.moveCursorToFirstCharacterOfLine()
+    if mode != 'visual'
+      @editor.setCursorScreenPosition([row, 0])
+      @editor.moveCursorToFirstCharacterOfLine()
+      @vimState.activateCommandMode()
 
 #
 # It outdents everything selected by the following motion.

  # Returns nothing.
  execute: (count=1) ->
    @indent(count, 'auto')
    @vimState.activateCommandMode()

module.exports = {Indent, Outdent, Autoindent}

  # Returns nothing.
  indent: (count, direction='indent') ->
    row = @editor.getCursorScreenRow()
    mode = @vimState.mode

    @motion.select(count)
    if direction == 'indent'
