trigger buffer-change after the change, not before

This commit is contained in:
Chris Wanstrath
2012-10-08 20:28:18 -07:00
parent 214735f1d7
commit 602f4ee233

View File

@@ -186,10 +186,11 @@ class Buffer
@change(range, '')
change: (oldRange, newText) ->
@trigger 'buffer-change'
oldRange = Range.fromObject(oldRange)
operation = new BufferChangeOperation({buffer: this, oldRange, newText})
@pushOperation(operation)
range = @pushOperation(operation)
@trigger 'buffer-change'
range
clipPosition: (position) ->
{ row, column } = Point.fromObject(position)