1 _ = require 'underscore-plus'
2 {Operator} = require './general-operators'
4 class AdjustIndentation extends Operator
8 originalRanges = @editor.getSelectedBufferRanges()
12 _.times(count ? 1, => @indent())
16 @editor.clearSelections()
17 @editor.getLastCursor().setBufferPosition([originalRanges.shift().start.row, 0])
18 for range in originalRanges
19 @editor.addCursorAtBufferPosition([range.start.row, 0])
20 @editor.moveToFirstCharacterOfLine()
21 @vimState.activateNormalMode()
23 class Indent extends AdjustIndentation
25 @editor.indentSelectedRows()
27 class Outdent extends AdjustIndentation
29 @editor.outdentSelectedRows()
31 class Autoindent extends AdjustIndentation
33 @editor.autoIndentSelectedRows()
35 module.exports = {Indent, Outdent, Autoindent}