mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Guard gitFirst/LastVisibleScreenRow
These methods are sometimes called by the model before the editor has been attached to the DOM.
This commit is contained in:
committed by
Antonio Scandurra
parent
eb7cdf2a34
commit
5ea4096464
@@ -2315,14 +2315,18 @@ class TextEditorComponent {
|
||||
}
|
||||
|
||||
getFirstVisibleRow () {
|
||||
return this.rowForPixelPosition(this.getScrollTop())
|
||||
if (this.measurements) {
|
||||
return this.rowForPixelPosition(this.getScrollTop())
|
||||
}
|
||||
}
|
||||
|
||||
getLastVisibleRow () {
|
||||
return Math.min(
|
||||
this.props.model.getApproximateScreenLineCount() - 1,
|
||||
this.rowForPixelPosition(this.getScrollBottom())
|
||||
)
|
||||
if (this.measurements) {
|
||||
return Math.min(
|
||||
this.props.model.getApproximateScreenLineCount() - 1,
|
||||
this.rowForPixelPosition(this.getScrollBottom())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
getFirstVisibleColumn () {
|
||||
|
||||
Reference in New Issue
Block a user