From 5072e43bb28e468718b3e1d8964c3611551d92ff Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 28 Oct 2007 22:27:15 +0000 Subject: [PATCH] Allow the ::delete-range handler to delete text after the text it was 2007-10-28 Owen Taylor * gtk/gtktextbuffer.c (gtk_text_buffer_delete_interactive): Allow the ::delete-range handler to delete text after the text it was explicitly asked to delete without confusing us as to whether we're currently on an editable or not-editable segment. (#491207) svn path=/trunk/; revision=18951 --- ChangeLog | 8 ++++++++ gtk/gtktextbuffer.c | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0e48fd8bb8..f57dbc7710 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-28 Owen Taylor + + * gtk/gtktextbuffer.c (gtk_text_buffer_delete_interactive): Allow + the ::delete-range handler to delete text after the text it was + explicitly asked to delete without confusing us as to whether + we're currently on an editable or not-editable segment. + (#491207) + 2007-10-26 Cody Russell * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 7acfcff577..bf48251152 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -1724,7 +1724,12 @@ gtk_text_buffer_delete_interactive (GtkTextBuffer *buffer, gtk_text_buffer_emit_delete (buffer, &start, &iter); - current_state = FALSE; + /* It's more robust to ask for the state again then to assume that + * we're on the next not-editable segment. We don't know what the + * ::delete-range handler did.... maybe it deleted the following not-editable + * segment because it was associated with the editable segment. + */ + current_state = gtk_text_iter_editable (&iter, default_editable); deleted_stuff = TRUE; /* revalidate user's iterators. */