mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Send more info on errors converting buffer positions to screen positions
We've gotten one rogue error but I have no idea how to reproduce it. This will tell us if soft wrap is enabled and if any folds are present so hopefully we can start narrowing these down.
This commit is contained in:
@@ -297,8 +297,12 @@ class DisplayBuffer extends Model
|
||||
[startScreenRow, endScreenRow] = @rowMap.screenRowRangeForBufferRow(row)
|
||||
for screenRow in [startScreenRow...endScreenRow]
|
||||
unless screenLine = @screenLines[screenRow]
|
||||
throw new Error("No screen line exists for screen row #{screenRow}, converted from buffer position (#{row}, #{column})")
|
||||
|
||||
throw new Error """
|
||||
No screen line exists for screen row #{screenRow}, converted from buffer position (#{row}, #{column})
|
||||
Soft wrap enabled: #{@getSoftWrap()}
|
||||
Fold count: #{@findFoldMarkers().length}
|
||||
Last buffer row: #{@getLastRow()}
|
||||
"""
|
||||
maxBufferColumn = screenLine.getMaxBufferColumn()
|
||||
if screenLine.isSoftWrapped() and column > maxBufferColumn
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user