mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Add assertion to debug NaN startRow on TextEditorPresenter
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
committed by
Nathan Sobo
parent
c5715e5211
commit
162a85a0e1
@@ -622,6 +622,18 @@ class TextEditorPresenter
|
||||
return unless @scrollTop? and @lineHeight?
|
||||
|
||||
@startRow = Math.max(0, @lineTopIndex.rowForPixelPosition(@scrollTop))
|
||||
atom.assert(
|
||||
Number.isFinite(@startRow),
|
||||
'Invalid start row',
|
||||
(error) =>
|
||||
error.metadata = {
|
||||
startRow: @startRow?.toString(),
|
||||
scrollTop: @scrollTop?.toString(),
|
||||
scrollHeight: @scrollHeight?.toString(),
|
||||
clientHeight: @clientHeight?.toString(),
|
||||
lineHeight: @lineHeight?.toString()
|
||||
}
|
||||
)
|
||||
|
||||
updateEndRow: ->
|
||||
return unless @scrollTop? and @lineHeight? and @height?
|
||||
|
||||
Reference in New Issue
Block a user