Preserve indentation when commenting

Previously this happened only when the language did not have a
comment end pattern.
This commit is contained in:
Kevin Sawicki
2014-04-29 16:12:22 -07:00
parent 2990f36595
commit 9cf642e910
2 changed files with 4 additions and 3 deletions

View File

@@ -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