Fix LanguageMode.proto.suggestedIndentationForBufferRow exception for row 0

This commit is contained in:
Nathan Sobo
2012-10-23 16:50:00 -06:00
parent b5b552737d
commit 4d9b777350
2 changed files with 10 additions and 1 deletions

View File

@@ -92,7 +92,8 @@ class LanguageMode
return currentIndentation unless increaseIndentPattern = TextMateBundle.indentRegexForScope(scopes[0])
currentLine = @buffer.lineForRow(bufferRow)
precedingRow = @buffer.previousNonBlankRow(bufferRow)
return currentIndentation unless precedingRow = @buffer.previousNonBlankRow(bufferRow)
precedingLine = @buffer.lineForRow(precedingRow)
desiredIndentation = @buffer.indentationForRow(precedingRow)