Handle indentation with mixed tabs and spaces

This commit is contained in:
Nathan Sobo
2015-06-30 12:32:10 -05:00
parent c0132ea04a
commit 82e25872b2
4 changed files with 21 additions and 14 deletions

View File

@@ -622,7 +622,7 @@ class Selection extends Model
else
currentIndentLevel = @editor.indentLevelForLine(lines[i])
indentLevel = Math.max(0, currentIndentLevel + indentAdjustment)
lines[i] = line.replace(/^(\t+| +)/, @editor.buildIndentString(indentLevel))
lines[i] = line.replace(/^[\t ]+/, @editor.buildIndentString(indentLevel))
return
# Indent the current line(s).