mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
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:
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user