mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🎨 rename ::getStart/EndRow to ::computeStart/EndRow
This commit is contained in:
@@ -1103,7 +1103,7 @@ describe "TextEditorComponent", ->
|
||||
nextAnimationFrame()
|
||||
|
||||
# Should not be rendering range containing the marker
|
||||
expect(component.presenter.getEndRow()).toBeLessThan 9
|
||||
expect(component.presenter.computeEndRow()).toBeLessThan 9
|
||||
|
||||
regions = componentNode.querySelectorAll('.some-highlight .region')
|
||||
|
||||
|
||||
@@ -148,8 +148,8 @@ class TextEditorPresenter
|
||||
|
||||
updateLinesState: ->
|
||||
visibleLineIds = {}
|
||||
startRow = @getStartRow()
|
||||
endRow = @getEndRow()
|
||||
startRow = @computeStartRow()
|
||||
endRow = @computeEndRow()
|
||||
|
||||
row = startRow
|
||||
while row < endRow
|
||||
@@ -194,8 +194,8 @@ class TextEditorPresenter
|
||||
@state.content.cursors = {}
|
||||
return unless @hasRequiredMeasurements()
|
||||
|
||||
startRow = @getStartRow()
|
||||
endRow = @getEndRow()
|
||||
startRow = @computeStartRow()
|
||||
endRow = @computeEndRow()
|
||||
|
||||
for cursor in @model.getCursors()
|
||||
if cursor.isVisible() and startRow <= cursor.getScreenRow() < endRow
|
||||
@@ -208,8 +208,8 @@ class TextEditorPresenter
|
||||
updateHighlightsState: ->
|
||||
return unless @hasRequiredMeasurements()
|
||||
|
||||
startRow = @getStartRow()
|
||||
endRow = @getEndRow()
|
||||
startRow = @computeStartRow()
|
||||
endRow = @computeEndRow()
|
||||
visibleHighlights = {}
|
||||
|
||||
for decoration in @model.getHighlightDecorations()
|
||||
@@ -274,8 +274,8 @@ class TextEditorPresenter
|
||||
@emitter.emit "did-update-state"
|
||||
|
||||
updateLineNumbersState: ->
|
||||
startRow = @getStartRow()
|
||||
endRow = @getEndRow()
|
||||
startRow = @computeStartRow()
|
||||
endRow = @computeEndRow()
|
||||
lastBufferRow = null
|
||||
wrapCount = 0
|
||||
visibleLineNumberIds = {}
|
||||
@@ -354,11 +354,11 @@ class TextEditorPresenter
|
||||
|
||||
regions
|
||||
|
||||
getStartRow: ->
|
||||
computeStartRow: ->
|
||||
startRow = Math.floor(@getScrollTop() / @getLineHeight()) - @lineOverdrawMargin
|
||||
Math.max(0, startRow)
|
||||
|
||||
getEndRow: ->
|
||||
computeEndRow: ->
|
||||
startRow = Math.floor(@getScrollTop() / @getLineHeight())
|
||||
visibleLinesCount = Math.ceil(@getHeight() / @getLineHeight()) + 1
|
||||
endRow = startRow + visibleLinesCount + @lineOverdrawMargin
|
||||
|
||||
Reference in New Issue
Block a user