GNOME Bugzilla – Bug 747202
undo should work on user actions
Last modified: 2016-04-22 18:14:13 UTC
Let's say I have three lines: some text some more text even more text Let's say I now type the following at the end of the second line: ... and even more text! Then let's say I highlight and copy the second line, press backspace, then paste what I copied after the last line Then I press Ctrl-z ... what I expect to happen is for the line I just pasted to be removed, but instead "... and even more text!" is removed from the end of the line. This doesn't happen consistently! I tried to come up with exact steps to reproduce, but it only happened maybe 20% of the time. This drives me crazy! I'm afraid to use undo, because I don't know what will happen :-(
i think i finally figured out a way to reproduce this ... 1) manually type the text appearing between the "===" separators into a note: ============================================== one two three a b c dog cat mouse ============================================== 2) use your mouse to move the cursor position to the right of "b" ... type another "b" 3) use your mouse to move the cursor position to the right of the "c" ... type another "c" 4) press and hold shift 5) use your mouse to move the cursor position to the right of "three" ... let go of shift (you just highlighted some text) 6) press Ctrl-c 7) press Backspace 8) use your mouse to move the cursor position to the right of "mouse" 9) press Ctrl-v 10) press Ctrl-z At this point, the following is what SHOULD appear: ============================================== one two three dog cat mouse ============================================== However, this is what ACTUALLY appears: ============================================== one two three dog cat mouse a bb ==============================================
There isn't much to worry here. The problem is that undo works on 'editor actions' rather than 'user actions', so it is a bit weird. When you paste a multiline text, it results in multiple editor actions, something like one action to add new line and one to add it's text. If you have text with formatting, the it leads to even more actions, as every chunk with unique formatting leads to a separate editor action. This gets more and more inconvenient as the amount of text pasted grows, because you have to perform undo many times instead of just one. Fixing this requires detecting paste and grouping all actions into single group that would behave like a single undo/redo action.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.