Ignore leading whitespace when auto-indenting a newline

Refs atom/language-less#1
This commit is contained in:
Kevin Sawicki
2014-03-18 19:02:35 -07:00
parent 532cfb5775
commit 8e62d772b3
4 changed files with 24 additions and 7 deletions

View File

@@ -301,7 +301,7 @@ class Selection
if options.autoIndent
@editor.autoIndentBufferRow(row) for row in newBufferRange.getRows()
else if options.autoIndentNewline and text == '\n'
@editor.autoIndentBufferRow(newBufferRange.end.row)
@editor.autoIndentBufferRow(newBufferRange.end.row, ignoreLeadingWhitespace: true)
else if options.autoDecreaseIndent and /\S/.test text
@editor.autoDecreaseIndentForBufferRow(newBufferRange.start.row)