kamalchopra / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Undo grouping is strange and deconcerting #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Type any line of text (at least 4-5 words), then press control-z several 
times to undo. Undo grouping seems random which is deconcerting.

Example of display before and after each undo:
- "This is an undo grouping test."
- "This is an undo grouping "
- "This is an u"
- "This is an "
- "This is an"
- "Th"
- ""

This can be very frustrating when editing two different parts of a file:
if you edit file at one place, then at a second place (possibly with 
scrolling between the two) and do undo, I would expect that it only undo 
the changes at the second place, but actually it may also undo changes at 
the first place too, because of the undo grouping, so you don't easily know 
what has been undone.

Program: JSyntaxPane Tester
Version: revision r111 of branch r095
OS: Window XP Pro.

Original issue reported on code.google.com by david.e...@gmail.com on 14 Apr 2009 at 12:26

GoogleCodeExporter commented 9 years ago
Thanks for the report.  I'm aware of this shortcoming.  The reason being the
UndoManager I'm using groups smaller edits by time.  So when you type fast, all
undo's are grouped together, until there is a slight pause in typing/changing, 
and
then all the fast-typed are grouped into one undo operation.
In theory, it works okay sometimes, and is better IMHO than an undo 
per-character
typed, which really gets irritating after a while.
I'll have a look at how this may possibly be enhanced, but it probably won't be 
soon.

Original comment by ayman.al...@gmail.com on 16 Apr 2009 at 5:38

GoogleCodeExporter commented 9 years ago
I managed to find a new, better UndoManager that does not depend on time, but 
the
position of edits.  

http://tips4java.wordpress.com/2008/10/27/compound-undo-manager/

This seem to be much better now for most of the Undo Issues.

Original comment by ayman.al...@gmail.com on 8 Nov 2009 at 10:15

GoogleCodeExporter commented 9 years ago
See fix in r117.  

Will be do a binary release shortly.

Original comment by ayman.al...@gmail.com on 8 Nov 2009 at 10:16