After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747202 - undo should work on user actions
undo should work on user actions
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
git master
Other All
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2015-04-01 19:47 UTC by Tony R.
Modified: 2016-04-22 18:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tony R. 2015-04-01 19:47:48 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 :-(
Comment 1 Tony R. 2015-04-01 20:05:01 UTC
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

==============================================
Comment 2 Aurimas Černius 2015-04-01 20:23:50 UTC
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.
Comment 3 Aurimas Černius 2016-04-22 18:14:13 UTC
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.