mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Add assertion to debug NaN startRow on TextEditorPresenter
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
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?
|
||||
|
Loading…
Reference in New Issue
Block a user