mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Assert that all buffer events are processed sequentially
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
committed by
Nathan Sobo
parent
94b4709db1
commit
4b6f09cd10
@@ -242,6 +242,16 @@ class TokenizedBuffer extends Model
|
||||
row + delta
|
||||
|
||||
handleBufferChange: (e) ->
|
||||
if @lastBufferChangeEventId?
|
||||
@assert(
|
||||
@lastBufferChangeEventId is e.eventId - 1,
|
||||
'Buffer Change Event Ids are not sequential',
|
||||
(error) =>
|
||||
error.metadata = {
|
||||
tokenizedBufferEventId: @lastBufferChangeEventId,
|
||||
nextTokenizedBufferEventId: e.eventId,
|
||||
}
|
||||
)
|
||||
@lastBufferChangeEventId = e.eventId
|
||||
@changeCount = @buffer.changeCount
|
||||
|
||||
|
||||
Reference in New Issue
Block a user