GNOME Bugzilla – Bug 172050
mark_set called too early when deleting text
Last modified: 2007-05-26 21:03:29 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:
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.
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.