mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Replace mentions of 'anchor' with 'tail' in selection and its spec
This commit is contained in:
parent
6beee10160
commit
80b39ae263
@ -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')
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user