Attach precipitating bufferChange to DisplayBuffer change events

The gutter can use this to determine if the change might have altered line numbers, for example if it's inside a fold.
This commit is contained in:
Nathan Sobo
2012-11-14 13:07:42 -07:00
parent 3b70df87a7
commit c68d5fac7d
3 changed files with 3 additions and 3 deletions

View File

@@ -207,7 +207,7 @@ class DisplayBuffer
@trigger 'change',
oldRange: oldScreenRange
newRange: newScreenRange
bufferChanged: true
bufferChange: e.bufferChange
lineNumbersChanged: !e.oldRange.coversSameRows(newRange) or !oldScreenRange.coversSameRows(newScreenRange)
buildLineForBufferRow: (bufferRow) ->

View File

@@ -61,7 +61,7 @@ class EditSession
@displayBuffer.on "change.edit-session-#{@id}", (e) =>
@trigger 'screen-lines-change', e
unless e.bufferChanged
unless e.bufferChange
anchor.refreshScreenPosition() for anchor in @getAnchors()
destroy: ->

View File

@@ -13,7 +13,7 @@ class Selection
@cursor.selection = this
@cursor.on 'change-screen-position.selection', (e) =>
@screenRangeChanged() unless e.bufferChanged
@screenRangeChanged() unless e.bufferChange
@cursor.on 'destroy.selection', =>
@cursor = null