mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
Only check for max line length when lines exist
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user