                 if changeObj.origin == 'undo'
                     return
                 if changeObj.origin? and changeObj.origin != 'setValue'
-                    line = changeObj.from.line
-                    mark = @find_input_mark(line)
-                    if mark?
-                        @remove_cell_flag(mark, FLAGS.this_session)
+                    @remove_this_session_flags_from_changeObj_range(changeObj)
 
                 if changeObj.origin == 'paste'
                     changeObj.cancel()

                uuids[z.text.slice(1,37)] = true
            return false
        return uuids

    remove_cell_flags_from_changeObj: (changeObj, flags, uuids) =>
        if not uuids?


class SynchronizedWorksheet extends SynchronizedDocument2
    constructor: (@editor, @opts) ->
        #window.w = @

        # these two lines are assumed, at least by the history browser
        @codemirror  = @editor.codemirror
        @codemirror1 = @editor.codemirror1
