🎨 rename ::getStart/EndRow to ::computeStart/EndRow

This commit is contained in:
Nathan Sobo
2015-01-29 15:31:31 -07:00
parent 4eb39b1be2
commit 510520d2c7
2 changed files with 11 additions and 11 deletions

View File

@@ -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')

View File

@@ -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