Throw exception when referencing a non-existent screen line

This commit is contained in:
Kevin Sawicki & Nathan Sobo
2013-06-18 14:32:48 -06:00
parent c86b8198d9
commit 01a7b5fbc6

View File

@@ -244,7 +244,9 @@ class DisplayBuffer
{ row, column } = @buffer.clipPosition(bufferPosition)
[startScreenRow, endScreenRow] = @rowMap.screenRowRangeForBufferRow(row)
for screenRow in [startScreenRow...endScreenRow]
screenLine = @screenLines[screenRow]
unless screenLine = @screenLines[screenRow]
throw new Error("No screen line exists for screen row #{screenRow}, converted from buffer position (#{row}, #{column})")
maxBufferColumn = screenLine.getMaxBufferColumn()
if screenLine.isSoftWrapped() and column > maxBufferColumn
continue