Clip range specified to change()

This commit is contained in:
Kevin Sawicki
2013-07-02 14:13:12 -07:00
parent 2d313e07ff
commit fddcbae4eb

View File

@@ -655,7 +655,7 @@ class TextBuffer
abort: -> @undoManager.abort()
change: (oldRange, newText, options={}) ->
oldRange = Range.fromObject(oldRange)
oldRange = @clipRange(oldRange)
newText = @normalizeLineEndings(oldRange.start.row, newText) if options.normalizeLineEndings ? true
operation = new BufferChangeOperation({buffer: this, oldRange, newText, options})
range = @pushOperation(operation)