Menu

#5 Undo/change mark special case

closed-later
nobody
Editor (71)
5
2002-06-26
2002-06-19
No

There is a special case where a saved change mark does
not become a change mark when an undo is performed.

Steps to reporduce

type: blah
- save the file
- change the text to: bblahlah
- save the file
- perform an undo
- notice that what should be a change mark is actually
a saved change mark.

Discussion

  • Peter Graves

    Peter Graves - 2002-06-26
    • status: open --> closed-later
     
  • Peter Graves

    Peter Graves - 2002-06-26

    Logged In: YES
    user_id=558172

    I'm not sure the current behavior is wrong, but I'm not sure
    it's right either.

    What j is doing, when you perform an undo in this scenario,
    is restoring the TextLine object exactly as it was when the
    undo information was saved before the last edit (which was
    "blah" => "bblahlah"). The TextLine object includes the
    flags which say what the state was at that time (in this
    case, it was a saved change, after you saved "blah"). When
    you perform the undo and restore the line, it still contains
    a saved change, even though the current text is not the same
    as the text on disk, since the undo you performed went back
    through the save.

    For what it's worth, Source Insight, which is the only other
    editor I know of that supports change marks, handles this
    scenario the same way j does.

    But I do see your point.

    The bottom line is that I don't want to change this behavior
    right now. When I get some time, I'd like to take another
    crack at revertLines(), which is really the killer feature
    in this area, and that work is likely to shed more light on
    this issue (which may turn out to be the tip of some iceberg
    or other).

    So I'm changing Status to "Pending" and Resolution to
    "Later", which seems like a reasonable way to park this bug
    for a while, even though I'm not exactly sure what those
    categories mean... ;)

     

Log in to post a comment.