mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Delegate getFirst/LastVisibleScreenRow from model to component
This commit is contained in:
committed by
Antonio Scandurra
parent
19f5535d68
commit
493b735740
@@ -3686,17 +3686,14 @@ class TextEditor extends Model
|
||||
|
||||
getFirstVisibleScreenRow: -> @firstVisibleScreenRow
|
||||
|
||||
getFirstVisibleScreenRow: ->
|
||||
@getElement().component.getFirstVisibleRow()
|
||||
|
||||
getLastVisibleScreenRow: ->
|
||||
if @height? and @lineHeightInPixels?
|
||||
Math.min(@firstVisibleScreenRow + Math.floor(@height / @lineHeightInPixels), @getScreenLineCount() - 1)
|
||||
else
|
||||
null
|
||||
@getElement().component.getLastVisibleRow()
|
||||
|
||||
getVisibleRowRange: ->
|
||||
if lastVisibleScreenRow = @getLastVisibleScreenRow()
|
||||
[@firstVisibleScreenRow, lastVisibleScreenRow]
|
||||
else
|
||||
null
|
||||
[@getFirstVisibleScreenRow(), @getLastVisibleScreenRow()]
|
||||
|
||||
setFirstVisibleScreenColumn: (@firstVisibleScreenColumn) ->
|
||||
getFirstVisibleScreenColumn: -> @firstVisibleScreenColumn
|
||||
|
||||
Reference in New Issue
Block a user