mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
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:
@@ -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) ->
|
||||
|
||||
@@ -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: ->
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user