diff --git a/spec/app/selection-spec.coffee b/spec/app/selection-spec.coffee index ef9e77de0..9a56e6118 100644 --- a/spec/app/selection-spec.coffee +++ b/spec/app/selection-spec.coffee @@ -40,7 +40,7 @@ describe "Selection", -> expect(buffer.lineForRow(0)).toBe "v;" expect(selection.isEmpty()).toBeTruthy() - describe "when the cursor precedes the anchor", -> + describe "when the cursor precedes the tail", -> it "deletes selected text and clears the selection", -> selection.cursor.setScreenPosition [0,13] selection.selectToScreenPosition [0,4] @@ -50,7 +50,7 @@ describe "Selection", -> expect(selection.isEmpty()).toBeTruthy() describe ".isReversed()", -> - it "returns true if the cursor precedes the anchor", -> + it "returns true if the cursor precedes the tail", -> selection.cursor.setScreenPosition([0, 20]) selection.selectToScreenPosition([0, 10]) expect(selection.isReversed()).toBeTruthy() @@ -58,7 +58,7 @@ describe "Selection", -> selection.selectToScreenPosition([0, 25]) expect(selection.isReversed()).toBeFalsy() - describe "when only the selection's anchor is moved (regression)", -> + describe "when only the selection's tail is moved (regression)", -> it "emits the 'screen-range-changed' event", -> selection.setBufferRange([[2, 0], [2, 10]], reverse: true) changeScreenRangeHandler = jasmine.createSpy('changeScreenRangeHandler') diff --git a/src/app/selection.coffee b/src/app/selection.coffee index 09d6f27b6..1ee467f7c 100644 --- a/src/app/selection.coffee +++ b/src/app/selection.coffee @@ -1,5 +1,4 @@ Range = require 'range' -Anchor = require 'anchor' EventEmitter = require 'event-emitter' _ = require 'underscore' @@ -335,16 +334,12 @@ class Selection modifySelection: (fn) -> @retainSelection = true - @editSession.placeMarkerTail(@marker) -# @anchor.pauseEvents() -# @cursor.pauseEvents() + @placeTail() fn() -# @anchor.resumeEvents() -# @cursor.resumeEvents() @retainSelection = false -# placeAnchor: -> -# @anchor.on 'moved.selection', => @screenRangeChanged() + placeTail: -> + @editSession.placeMarkerTail(@marker) intersectsBufferRange: (bufferRange) -> @getBufferRange().intersectsWith(bufferRange)