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 588098 - Undo/Redo breaks with bulleted lists
Undo/Redo breaks with bulleted lists
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
0.5.x
Other All
: Normal major
: ---
Assigned To: Aurimas Černius
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-08 17:49 UTC by ulrik sverdrup
Modified: 2011-02-13 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix redo with new bulletted row. (1.00 KB, patch)
2010-10-14 17:55 UTC, Aurimas Černius
committed Details | Review
Add is_bullet method to NoteBuffer. (1.46 KB, patch)
2010-10-24 20:13 UTC, Aurimas Černius
none Details | Review
Patch to fix the bug. (1.70 KB, patch)
2010-10-24 20:19 UTC, Aurimas Černius
none Details | Review
Add is_bullet method to NoteBuffer. (1.46 KB, patch)
2011-01-25 20:47 UTC, Aurimas Černius
none Details | Review
Fix for the bug. (3.79 KB, patch)
2011-02-04 20:52 UTC, Aurimas Černius
none Details | Review

Description ulrik sverdrup 2009-07-08 17:49:48 UTC
Please describe the problem:
Undo/Redo breaks with bulleted lists.

Steps to reproduce:
1. it should be so easy that I don't need to attach anything
2. Enable bulleted lists
3. Create simple list in two lines or more, for example
* Do work
* Read wikipedia

4. Now make a multi-line selection in the list, copy, insert anywhere, so that you in have a duplicate of the list

5. Now use Undo twice, Redo twice, repeat in cycles one or two or three or more, see that nothing makes sense. Undo enough until gnote crashes.


Actual results:
Some iterator or something points wrong, because Undo doesn't undo what was done.

Expected results:
 

Does this happen every time?
yes

Other information:
gnote version is debian 0.5.2-1
Comment 1 Aurimas Černius 2010-10-14 17:55:07 UTC
Created attachment 172372 [details] [review]
Fix redo with new bulletted row.

This patch solves part of the problem - redo starts to work for enter key in bulleted row.
Multi-line paste is still an issue (looks like the same issue exists in Tomboy).
Comment 2 Hubert Figuiere (:hub) 2010-10-18 02:24:12 UTC
Comment on attachment 172372 [details] [review]
Fix redo with new bulletted row.

nice catch. looks good.
Comment 3 Aurimas Černius 2010-10-18 19:15:30 UTC
Review of attachment 172372 [details] [review]:

Committed.
Comment 4 Aurimas Černius 2010-10-18 19:24:14 UTC
The problem with multi-line paste still remains, so I leave this bug open.

I found this:
1. Multi-line paste is split to pieces, so many small text inserts happen.
2. New line is pasted as separate text insert.
3. Bullet is pasted as text entry.
4. The (2) and (3) become separate undo actions. Doing redo a depth tag is lost and bulletted item becomes simple text.


My suggestion would be to improve bullet insertion undo action to have a flag, whether to insert new line. The during paste, a bullet insertion can be identified and appropriate undo action can be added.
Also, when adding new bullet insert action without new line, it could be merged with preceding new line insertion.
Comment 5 Aurimas Černius 2010-10-21 20:02:45 UTC
Corresponding Tomboy Bug 632828.
Comment 6 Aurimas Černius 2010-10-24 20:13:40 UTC
Created attachment 173135 [details] [review]
Add is_bullet method to NoteBuffer.

Used by next patch and might be useful for something else.
Comment 7 Aurimas Černius 2010-10-24 20:19:56 UTC
Created attachment 173136 [details] [review]
Patch to fix the bug.

Not perfect solution, but at least seems to work right.

1. Emit "increase depth" signal instead of "insert text", when bullet is pasted.
2. For text paste, emit appropriate number of "increase depth" signals.

There probably are bugs in this patch, so any help is appreciated.
Comment 8 Aurimas Černius 2011-01-25 20:47:52 UTC
Created attachment 179322 [details] [review]
Add is_bullet method to NoteBuffer.

Fixed error in patch.
Comment 9 Aurimas Černius 2011-02-04 20:52:00 UTC
Created attachment 180112 [details] [review]
Fix for the bug.

Updated the patch.
Some code refactoring, to make it more readable.
Comment 10 Aurimas Černius 2011-02-13 16:52:04 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.