GNOME Bugzilla – Bug 155890
End of line doesn't go to end of line
Last modified: 2011-02-04 16:17:18 UTC
Please describe the problem: Pressing the End key on my keyboard should move the cursor to the end of the current line, but it doesn't; it moves the cursor to the penultimate character. Steps to reproduce: 1. Disable word wrap 2. Type a long line of text until it reaches the edge of the windows and flows onto the next line 3. Move the cursor to the first line of text 4. Press the End key Actual results: The cursor ends up just before the last character Expected results: The cursor moves to after the last character Does this happen every time? Yes Other information:
moving to gtktextview. The bug can be reproduced with gtk-demo's multiple text views example, in the "This line has character-based wrapping, and can wrap between any two character glyphs. Let's make this a long paragraph to demonstrate: blah blah blah blah blah " paragraph.
Here's a comment from pango-layout.c that describes the problem: /* This is a HACK. If a program only keeps track if cursor (etc) * indices and not the trailing flag, then the trailing index of the * last character on a wrapped line is identical to the leading * index of the next line. So, we fake it and set the trailing flag * to zero. * * That is, if the text is "now is the time", and is broken between * 'now' and 'is' * * Then when the cursor is actually at: * * n|o|w| |i|s| * ^ * we lie and say it is at: * * n|o|w| |i|s| * ^ * * So the cursor won't appear on the next line before 'the'. * * Actually, any program keeping cursor * positions with wrapped lines should distinguish leading and * trailing cursors. */ It's not very noticeable with Latin text because lines typically end on spaces, but is much worse for CJK/Thai/etc. *** This bug has been marked as a duplicate of 81412 ***