mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Preserve indentation when commenting
Previously this happened only when the language did not have a comment end pattern.
This commit is contained in:
@@ -60,7 +60,8 @@ class LanguageMode
|
||||
buffer.setTextInRange([[end, endColumn], [end, endLength]], "")
|
||||
else
|
||||
buffer.transact ->
|
||||
buffer.insert([start, 0], commentStartString)
|
||||
indentLength = buffer.lineForRow(start).match(/^\s*/)?[0].length ? 0
|
||||
buffer.insert([start, indentLength], commentStartString)
|
||||
buffer.insert([end, buffer.lineLengthForRow(end)], commentEndString)
|
||||
else
|
||||
if shouldUncomment and start isnt end
|
||||
|
||||
Reference in New Issue
Block a user