Only indent the line following a '\n' not the line preceding it

This commit is contained in:
probablycorey
2013-05-07 15:58:25 -07:00
parent 9d2b7875b9
commit c34db290e4
2 changed files with 15 additions and 1 deletions

View File

@@ -273,8 +273,10 @@ class Selection
else
@cursor.setBufferPosition(newBufferRange.end, skipAtomicTokens: true) if wasReversed
if options.autoIndent or (options.autoIndentNewline and text == '\n')
if options.autoIndent
@editSession.autoIndentBufferRow(row) for row in newBufferRange.getRows()
else if options.autoIndentNewline and text == '\n'
@editSession.autoIndentBufferRow(newBufferRange.end.row)
else if options.autoDecreaseIndent and /\S/.test text
@editSession.autoDecreaseIndentForRow(newBufferRange.start.row)