Merge pull request #7798 from atom/ns-undefined-screen-line-metadata

Report extra metadata when screen lines are undefined when clipping
This commit is contained in:
Nathan Sobo 2015-07-08 17:01:29 -05:00
commit 9c63de930e

View File

@ -890,6 +890,17 @@ class DisplayBuffer extends Model
column = 0
screenLine = @tokenizedLineForScreenRow(row)
unless screenLine?
error = new Error("Undefined screen line when clipping screen position")
Error.captureStackTrace(error)
error.metadata = {
screenRow: row
screenColumn: column
maxScreenRow: @getLastRow()
screenLinesDefined: @screenLines.map (sl) -> sl?
}
throw error
maxScreenColumn = screenLine.getMaxScreenColumn()
if screenLine.isSoftWrapped() and column >= maxScreenColumn