From a3ff0ad75a60a528726a019931b7c9fa8b2e8018 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 28 Oct 2015 15:08:50 -0600 Subject: [PATCH] :art: Rename method --- spec/text-editor-spec.coffee | 14 +++++++------- src/display-buffer.coffee | 2 +- src/text-editor-presenter.coffee | 2 +- src/text-editor.coffee | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 0bd5484d6..95f40f3ff 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5601,17 +5601,17 @@ describe "TextEditor", -> describe "decorations", -> describe "::decorateMarker", -> - it "includes the decoration in the object returned from ::decorationStateForScreenRowRange", -> + it "includes the decoration in the object returned from ::decorationsStateForScreenRowRange", -> marker = editor.markBufferRange([[2, 4], [6, 8]]) decoration = editor.decorateMarker(marker, type: 'highlight', class: 'foo') - expect(editor.decorationStateForScreenRowRange(0, 5)[decoration.id]).toEqual { + expect(editor.decorationsStateForScreenRowRange(0, 5)[decoration.id]).toEqual { properties: {type: 'highlight', class: 'foo'} screenRange: marker.getScreenRange(), rangeIsReversed: false } describe "::decorateMarkerLayer", -> - it "based on the markers in the layer, includes multiple decoration objects with the same properties and different ranges in the object returned from ::decorationStateForScreenRowRange", -> + it "based on the markers in the layer, includes multiple decoration objects with the same properties and different ranges in the object returned from ::decorationsStateForScreenRowRange", -> layer1 = editor.getBuffer().addMarkerLayer() marker1 = layer1.markRange([[2, 4], [6, 8]]) marker2 = layer1.markRange([[11, 0], [11, 12]]) @@ -5622,7 +5622,7 @@ describe "TextEditor", -> layer1Decoration2 = editor.decorateMarkerLayer(layer1, type: 'highlight', class: 'bar') layer2Decoration = editor.decorateMarkerLayer(layer2, type: 'highlight', class: 'baz') - decorationState = editor.decorationStateForScreenRowRange(0, 13) + decorationState = editor.decorationsStateForScreenRowRange(0, 13) expect(decorationState["#{layer1Decoration1.id}-#{marker1.id}"]).toEqual { properties: {type: 'highlight', class: 'foo'}, @@ -5652,7 +5652,7 @@ describe "TextEditor", -> layer1Decoration1.destroy() - decorationState = editor.decorationStateForScreenRowRange(0, 12) + decorationState = editor.decorationsStateForScreenRowRange(0, 12) expect(decorationState["#{layer1Decoration1.id}-#{marker1.id}"]).toBeUndefined() expect(decorationState["#{layer1Decoration1.id}-#{marker2.id}"]).toBeUndefined() expect(decorationState["#{layer1Decoration2.id}-#{marker1.id}"]).toEqual { @@ -5672,7 +5672,7 @@ describe "TextEditor", -> } layer1Decoration2.setPropertiesForMarker(marker1, {type: 'highlight', class: 'quux'}) - decorationState = editor.decorationStateForScreenRowRange(0, 12) + decorationState = editor.decorationsStateForScreenRowRange(0, 12) expect(decorationState["#{layer1Decoration2.id}-#{marker1.id}"]).toEqual { properties: {type: 'highlight', class: 'quux'}, screenRange: marker1.getRange(), @@ -5680,7 +5680,7 @@ describe "TextEditor", -> } layer1Decoration2.setPropertiesForMarker(marker1, null) - decorationState = editor.decorationStateForScreenRowRange(0, 12) + decorationState = editor.decorationsStateForScreenRowRange(0, 12) expect(decorationState["#{layer1Decoration2.id}-#{marker1.id}"]).toEqual { properties: {type: 'highlight', class: 'bar'}, screenRange: marker1.getRange(), diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index e547fd31f..331f50fa2 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -776,7 +776,7 @@ class DisplayBuffer extends Model decorationsByMarkerId[marker.id] = decorations decorationsByMarkerId - decorationStateForScreenRowRange: (startScreenRow, endScreenRow) -> + decorationsStateForScreenRowRange: (startScreenRow, endScreenRow) -> decorationState = {} startBufferRow = @bufferRowForScreenRow(startScreenRow) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index cb3024494..891252730 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -1168,7 +1168,7 @@ class TextEditorPresenter fetchDecorations: -> return unless 0 <= @startRow <= @endRow <= Infinity - @decorations = @model.decorationStateForScreenRowRange(@startRow, @endRow - 1) + @decorations = @model.decorationsStateForScreenRowRange(@startRow, @endRow - 1) updateLineDecorations: -> @lineDecorationsByScreenRow = {} diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 5d4d7bba4..81e2f9ecc 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -1481,8 +1481,8 @@ class TextEditor extends Model decorationsForScreenRowRange: (startScreenRow, endScreenRow) -> @displayBuffer.decorationsForScreenRowRange(startScreenRow, endScreenRow) - decorationStateForScreenRowRange: (startScreenRow, endScreenRow) -> - @displayBuffer.decorationStateForScreenRowRange(startScreenRow, endScreenRow) + decorationsStateForScreenRowRange: (startScreenRow, endScreenRow) -> + @displayBuffer.decorationsStateForScreenRowRange(startScreenRow, endScreenRow) # Extended: Get all decorations. #