         pos = {line:0, ch:0}  # start at the beginning
         last_pos = undefined
         for chunk in diff
-            #console.log(chunk)
             op  = chunk[0]  # 0 = stay same; -1 = delete; +1 = add
             val = chunk[1]  # the actual text to leave same, delete, or add
             pos1 = next_pos(val, pos)

        if changeObj?
            @apply_changeObj(changeObj)

    # Set the value of the buffer to something new by replacing just the ranges
    # that changed, so that the view/history/etc. doesn't get messed up.
    # Setting scroll_last to ture sets cursor to last changed position and puts cursors
    # there; this is used for undo/redo.
    CodeMirror.defineExtension 'setValueNoJump', (value, scroll_last) ->
        if not value?
            # Special case -- trying to set to value=undefined.  This is the sort of thing

            return
        current_value = @getValue()
        if value == current_value
            # Special case: nothing to do
            return

        r = @getOption('readOnly')
