Rename anchor.ignoreEqual to anchor.ignoreChangesStartingOnAnchor

This commit is contained in:
Corey Johnson
2012-10-31 14:24:01 -07:00
parent 84ea1017f4
commit dbf8639375
3 changed files with 6 additions and 6 deletions

View File

@@ -630,9 +630,9 @@ describe 'Buffer', ->
anchor = buffer.addAnchorAtPosition([4, 25])
anchor.on 'destroy', destroyHandler
describe "when anchor.ignoreEqual is true", ->
describe "when anchor.ignoreChangesStartingOnAnchor is true", ->
beforeEach ->
anchor.ignoreEqual = true
anchor.ignoreChangesStartingOnAnchor = true
describe "when the change ends before the anchor position", ->
it "moves the anchor", ->

View File

@@ -9,7 +9,7 @@ class AnchorRange
constructor: (bufferRange, @buffer, @editSession) ->
bufferRange = Range.fromObject(bufferRange)
@startAnchor = @buffer.addAnchorAtPosition(bufferRange.start, ignoreEqual: true)
@startAnchor = @buffer.addAnchorAtPosition(bufferRange.start, ignoreChangesStartingOnAnchor: true)
@endAnchor = @buffer.addAnchorAtPosition(bufferRange.end)
getBufferRange: ->

View File

@@ -8,11 +8,11 @@ class Anchor
editSession: null # optional
bufferPosition: null
screenPosition: null
ignoreEqual: false
ignoreChangesStartingOnAnchor: false
strong: false
constructor: (@buffer, options = {}) ->
{ @editSession, @ignoreEqual, @strong } = options
{ @editSession, @ignoreChangesStartingOnAnchor, @strong } = options
handleBufferChange: (e) ->
{ oldRange, newRange } = e
@@ -25,7 +25,7 @@ class Anchor
@destroy()
return
return if @ignoreEqual and position.isEqual(oldRange.start)
return if @ignoreChangesStartingOnAnchor and position.isEqual(oldRange.start)
return if position.isLessThan(oldRange.end)
newRow = newRange.end.row