Only check for max line length when lines exist

This commit is contained in:
Nathan Sobo
2015-06-05 23:40:56 +02:00
parent 3ac9d539ce
commit 88812831ce

View File

@@ -483,11 +483,11 @@ class DisplayBuffer extends Model
# Returns {TokenizedLine}
tokenizedLineForScreenRow: (screenRow) ->
if @largeFileMode
line = @tokenizedBuffer.tokenizedLineForRow(screenRow)
if line.text.length > @maxLineLength
@maxLineLength = line.text.length
@longestScreenRow = screenRow
line
if line = @tokenizedBuffer.tokenizedLineForRow(screenRow)
if line.text.length > @maxLineLength
@maxLineLength = line.text.length
@longestScreenRow = screenRow
line
else
@screenLines[screenRow]