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 702075 - Moving the caret cursor between lines is confusing
Moving the caret cursor between lines is confusing
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-12 10:31 UTC by Carlos Garcia Campos
Modified: 2013-06-26 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Keep the offset when moving between lines (5.12 KB, patch)
2013-06-18 17:47 UTC, Antía Puentes
needs-work Details | Review
Keep the offset when moving between lines (7.19 KB, patch)
2013-06-19 14:44 UTC, Antía Puentes
none Details | Review
Keep the cursor x coordinate when moving between lines (2.30 KB, patch)
2013-06-26 15:53 UTC, Antía Puentes
committed Details | Review

Description Carlos Garcia Campos 2013-06-12 10:31:23 UTC
When moving the previous line the cursor is positioned at the end of the line and moving to the next line places the cursor at the beginning of the line. This is very confusing, we should keep the line offset and try to keep it when moving between lines.
Comment 1 Antía Puentes 2013-06-18 17:47:12 UTC
Created attachment 247190 [details] [review]
Keep the offset when moving between lines
Comment 2 Carlos Garcia Campos 2013-06-19 11:07:54 UTC
Review of attachment 247190 [details] [review]:

This works much better but it's still not consistent with other apps. With this patch the current offset is always used as line offset, so that if you move to a line shorter than the current line, the clamped offset (current line length) is used as the line offset when moving to another line. What we want is to keep a global line offset that is only updated when the cursor is moved horizontally, and it's always used when moving vertically. You can check this behaviour with gedit or libreoffice.
Comment 3 Antía Puentes 2013-06-19 14:44:19 UTC
Created attachment 247264 [details] [review]
Keep the offset when moving between lines

Patch updated according to comments in comment 2.
Comment 4 Antía Puentes 2013-06-26 15:53:55 UTC
Created attachment 247838 [details] [review]
Keep the cursor x coordinate when moving between lines

The previous patch kept the cursor_offset when moving between lines, but as the bounding box sizes are quite different depending on the character, the caret still oscillates too much.

The current patch keeps, instead of the cursor_offset, the x coordinate of the cursor (in terms of view coordinates) and positions the caret in character of the corresponding line closer to that x coordinate.
Comment 5 Carlos Garcia Campos 2013-06-26 16:18:48 UTC
Comment on attachment 247838 [details] [review]
Keep the cursor x coordinate when moving between lines

Pushed to git master, thanks!