Merge pull request #10878 from atom/ku-allow-pasting-white-space

Allow pasting white space when `autoIndentOnPaste` is enabled
This commit is contained in:
Katrina Uychaco
2016-02-18 13:57:06 -08:00
2 changed files with 9 additions and 1 deletions

View File

@@ -378,7 +378,7 @@ class Selection extends Model
indentAdjustment = @editor.indentLevelForLine(precedingText) - options.indentBasis
@adjustIndent(remainingLines, indentAdjustment)
if options.autoIndent and not NonWhitespaceRegExp.test(precedingText) and remainingLines.length > 0
if options.autoIndent and NonWhitespaceRegExp.test(text) and not NonWhitespaceRegExp.test(precedingText) and remainingLines.length > 0
autoIndentFirstLine = true
firstLine = precedingText + firstInsertedLine
desiredIndentLevel = @editor.languageMode.suggestedIndentForLineAtBufferRow(oldBufferRange.start.row, firstLine)