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 172050 - mark_set called too early when deleting text
mark_set called too early when deleting text
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.6.x
Other All
: Normal normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-03-30 00:34 UTC by Alex Graveley
Modified: 2007-05-26 21:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (878 bytes, text/plain)
2005-03-30 00:58 UTC, Alex Graveley
Details
Modified test case (998 bytes, text/plain)
2005-12-06 06:55 UTC, Yevgen Muntyan
Details

Description Alex Graveley 2005-03-30 00:34:01 UTC
Please describe the problem:
The mark_set event is emitted too early for the "insert" and "selection_bound"
marks when highlighted text is being deleted, before the text has actually been
removed or the marks reset. Calling gtk_text_buffer_get_selection_bounds() and 
gtk_text_buffer_get_text() inside mark_set handler returns the text that is
being deleted.  

This means that if you need to change the state of something based on whether
any text is selected, you must set an idle handler.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Alex Graveley 2005-03-30 00:58:53 UTC
Created attachment 39413 [details]
Test case

Type some text, select it, then delete it.  The mark_set handler prints the
text that is being deleted, when it shouldn't print anything.
Comment 2 Yevgen Muntyan 2005-12-06 06:55:40 UTC
Created attachment 55673 [details]
Modified test case

This code shows that the bug doesn't exist. There are some misterious marks
which are set during deleting text, but the insert and selection-bound marks
are fine - when you get mark-set for them, the text is already deleted.