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 90435 - Highlighting problem
Highlighting problem
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.0.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
: 75859 81848 98440 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-08-10 23:37 UTC by Mohammed Sameer
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screen shot of the problem in gedit 2 (630 bytes, image/png)
2002-08-10 23:40 UTC, Mohammed Sameer
  Details
C code to demonstrate (2.80 KB, text/plain)
2002-10-12 17:17 UTC, Mohammed Sameer
  Details
patch (1.11 KB, patch)
2002-12-25 00:13 UTC, Matthias Clasen
none Details | Review

Description Mohammed Sameer 2002-08-10 23:37:22 UTC
Can't demonstrate the problem other than that sorry,
Fire up gedit 2
enter a letter "a"
then press 2 enters, insert another "a"
open the find dialog
and search for "a" from the beginning
the letter'll be highlighted
press find again and u'll see what i mean
it highlights the whole line above it
yes it's a gtk bug cause it's a problem with a text editor i'm working on 
and sure i didn't rip code from gedit ;)
Comment 1 Mohammed Sameer 2002-08-10 23:40:59 UTC
Created attachment 10410 [details]
screen shot of the problem in gedit 2
Comment 2 Havoc Pennington 2002-10-11 22:31:36 UTC
Can you attach a small compilable test case showing how the
highlighting is done?
Comment 3 Mohammed Sameer 2002-10-12 17:15:26 UTC
Attached a C code,
press "search" 2 times
it seems that the problem is with empty lines.
Comment 4 Mohammed Sameer 2002-10-12 17:17:38 UTC
Created attachment 11508 [details]
C code to demonstrate
Comment 5 Luis Villa 2002-12-05 21:04:09 UTC
*** Bug 81848 has been marked as a duplicate of this bug. ***
Comment 6 Luis Villa 2002-12-05 21:04:48 UTC
The dup has a slightly better description of how to repro, but no
screenshot or description.
Comment 7 Luis Villa 2002-12-05 21:32:24 UTC
*** Bug 98440 has been marked as a duplicate of this bug. ***
Comment 8 Matthias Clasen 2002-12-25 00:13:48 UTC
Created attachment 13202 [details] [review]
patch
Comment 9 Matthias Clasen 2002-12-25 00:18:32 UTC
The patch fixes the problem which is caused by the call to
gtk_text_iter_forward_to_line_end() inadvertedly moving to the end
of the next line when called on an empty lines. The fix is to call
that function only when not already at a line end. Looking at other
uses of
gtk_text_iter_forward_to_line_end(), 90% of all calls are protected
like this, so maybe there should be a utility function for this.

The second part of the patch makes sure that empty lines *are*
highlighted when they are contained in a selection. This also fixes
bug 90582.
Comment 10 Havoc Pennington 2002-12-25 02:15:30 UTC
Looks good, thanks.
Comment 11 Matthias Clasen 2002-12-26 00:19:31 UTC
*** Bug 75859 has been marked as a duplicate of this bug. ***