Replace mentions of 'anchor' with 'tail' in selection and its spec

This commit is contained in:
Nathan Sobo 2013-02-02 16:44:13 -07:00
parent 6beee10160
commit 80b39ae263
2 changed files with 6 additions and 11 deletions

View File

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

View File

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