mirror of
https://github.com/atom/atom.git
synced 2026-02-07 21:25:05 -05:00
If inserting on a line that is longer than the suggested indent, preserve indent
This commit is contained in:
@@ -168,11 +168,11 @@ class Selection
|
||||
normalizedLines.join('\n')
|
||||
|
||||
adjustIndentationForLine: (line, delta) ->
|
||||
indentText = new Array(Math.abs(delta + 1)).join(' ')
|
||||
indentText = new Array(Math.abs(delta) + 1).join(' ')
|
||||
if delta > 0
|
||||
indentText + line
|
||||
else if delta < 0
|
||||
line.replace(indentText, '')
|
||||
line.replace(new RegExp("^#{indentText}"), '')
|
||||
else
|
||||
line
|
||||
|
||||
|
||||
Reference in New Issue
Block a user