Fix off-by-one error that was masked by TextMateLanguageMode

TextMateLanguageMode.isRowCommented would return `undefined` instead of 
`false` for out-of-bounds rows.
This commit is contained in:
Max Brunsfeld
2018-08-21 15:09:48 -07:00
parent d1283fa69f
commit d937f14265

View File

@@ -4843,7 +4843,7 @@ class TextEditor {
let endRow = bufferRow
const rowCount = this.getLineCount()
while (endRow < rowCount) {
while (endRow + 1 < rowCount) {
if (!NON_WHITESPACE_REGEXP.test(this.lineTextForBufferRow(endRow + 1))) break
if (languageMode.isRowCommented(endRow + 1) !== isCommented) break
endRow++