diff --git a/src/editor.coffee b/src/editor.coffee index 7a58c8c5e..d06f964e7 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -374,10 +374,10 @@ class Editor extends Model # bufferRow - A {Number} indicating the buffer row. # newLevel - A {Number} indicating the new indentation level. # options - An {Object} with the following keys: - # :ignoreLeadingWhitespace - true to not replace any of the leading - # whitespace already on the line (default: false) - setIndentationForBufferRow: (bufferRow, newLevel, {ignoreLeadingWhitespace}={}) -> - if ignoreLeadingWhitespace + # :preserveLeadingWhitespace - true to preserve any whitespace already on + # the line (default: false). + setIndentationForBufferRow: (bufferRow, newLevel, {preserveLeadingWhitespace}={}) -> + if preserveLeadingWhitespace endColumn = 0 else endColumn = @lineForBufferRow(bufferRow).match(/^\s*/)[0].length diff --git a/src/selection.coffee b/src/selection.coffee index 7c357cdb1..795e93004 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -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, ignoreLeadingWhitespace: true) + @editor.autoIndentBufferRow(newBufferRange.end.row, preserveLeadingWhitespace: true) else if options.autoDecreaseIndent and /\S/.test text @editor.autoDecreaseIndentForBufferRow(newBufferRange.start.row)