Ticket #26 (accepted defect) — at Version 19

Opened 16 years ago

Last modified 8 years ago

savannah: undo does not reset "modified" status

Reported by: ossi Owned by: styx
Priority: minor Milestone: Future Releases
Component: mcedit Version: master
Keywords: Cc: zaytsev, mooffie@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by ossi) (diff)

Original: http://savannah.gnu.org/bugs/?13737

Submitted by:Oswald Buddenhagen <ossi>Submitted on:Mon 11 Jul 2005 07:56:26 PM UTC
Category:EditorSeverity:3 - Normal
Status:NonePrivacy:Public
Assigned to:NoneOpen/Closed:Open
Release:current (CVS or snapshot)Operating System:All

Original submission:

i often accidentally do minor modifications (mostly partial escape 
sequences) which i undo of course. anyway, afterwards i still don't 
know if this was the only modification.

some considerations for the implementation:
- movements don't change the modified status, so you can't just 
check whether the undo stack is at the last file save point
- undo of changes past the last file save point must re-assert the 
modified status
- at file save points, it would make sense to stop undoing if it 
results from keyboard auto-reapeat (which can be assumed if the 
same sequence arrives (lets say) fife times within one second). 
undo will be resumed when the key is re-asserted after a pause. 

Change History

comment:1 Changed 16 years ago by styx

  • Milestone set to 4.7

comment:2 Changed 15 years ago by angel_il

  • severity set to no branch
  • Milestone changed from 4.7 to 4.7.0-pre2

comment:3 Changed 15 years ago by styx

  • Owner set to styx
  • Status changed from new to accepted

comment:4 Changed 15 years ago by styx

  • severity changed from no branch to on review

branch: 26_undo_reset_modified
changeset: 79748bad3d00cfa2eb164711a899aeda4666d6e6

Check pls, is 'edit->stack_wrapped = TRUE;' placed well and have an additional look for this place:
/*If a single key produced enough pushes to wrap all the way round then ...
It looks like stack_wrapped = TRUE should be placed there but practice says 'no'...

comment:5 Changed 15 years ago by styx

  • Version set to master

comment:6 follow-up: ↓ 7 Changed 15 years ago by iNode

Open file, write test (change flag is up), press F2(chabge flag is down).
Press C-u once (change flag is up), again, again, again (change flag is down).
Is it correct behavoiur?

comment:7 in reply to: ↑ 6 Changed 15 years ago by ossi

Replying to iNode:

Is it correct behavoiur?

doesn't sound so. imagine the undo history as a stream of changes. each time when a file is loaded or saved (i.e., when the editor buffer is synchronized with the disk contents), the pointer for the unmodified state is set. now, if the "action" pointer is moved through the history (via undo or (the non-existing) redo), you look whether there are any modifying commands between the action pointer and the unmodified state pointer - if so, you raise the modified flag. of course, the checking should happen incrementally, possibly by inc-/decrementing a counter each time a modifying command is un-/redone.

comment:8 follow-up: ↓ 10 Changed 15 years ago by angel_il

Is it correct behavoiur?

i think it's really correct behavoiur. after your file saved you add new changes.

comment:9 Changed 15 years ago by angel_il

  • Votes for changeset set to angel_il

comment:10 in reply to: ↑ 8 Changed 15 years ago by iNode

Replying to angel_il:

Is it correct behavoiur?

i think it's really correct behavoiur. after your file saved you add new changes.

May be I should use special markup for incorrect behavoiur: change flag is down not in history position where we save file.

comment:11 Changed 15 years ago by iNode

  • Votes for changeset angel_il deleted
  • severity changed from on review to on rework

comment:12 Changed 15 years ago by slavazanko

  • Milestone changed from 4.7.0-pre2 to 4.7.0-pre3

comment:13 Changed 15 years ago by iNode

Use case: user open file, edit and save. He understand bug in changes (invalid state) and undo to open file position. And quit without save or confirmations because change flag is down, but file on disc in invalid state.

comment:14 Changed 15 years ago by iNode

  • Milestone changed from 4.7.0-pre3 to 4.7.0-pre4

comment:15 Changed 15 years ago by slavazanko

  • Milestone changed from 4.7.0-pre4 to 4.7

comment:16 Changed 14 years ago by ossi

  • Cc ossi@… added

comment:17 Changed 14 years ago by zaytsev

  • Cc zaytsev added

comment:18 Changed 13 years ago by andrew_b

  • Branch state set to no branch
  • Milestone changed from 4.7 to Future Releases

comment:19 Changed 11 years ago by ossi

  • Cc ossi@… removed
  • Description modified (diff)
  • Reporter changed from slavazanko to ossi
Note: See TracTickets for help on using tickets.