GNOME Bugzilla – Bug 60630
Cursor position not always displayed in GtkTextView
Last modified: 2011-02-04 16:09:32 UTC
Use the program testtext in gtk+/tests. Use Test|Example to add text and choose Settings|Wrap Off. Move the cursor to just before the last "text" in line 2. Press the up arrow key. The cursor is at the end of line 1 but the start of line 1 is on the screen.
The function gtk_text_layout_get_iter_location() seems to return the wrong rectangle. The problem seems to be the behavior of pango_layout_index_to_pos() when the byte index corresponds to the end of the line. The function pango_layout_iter_get_run_extents() is called with NULL ink extents.
Created attachment 5626 [details] [review] patch to pango/pango-layout.c
I have attached a propsoed change to pango/pango-layoout.c to fix the problem.
Mon Sep 24 18:19:22 2001 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_index_to_pos): Fix handling of the last index in a paragraph. (#60630, fix based on patch from Padraig O'Briain.)