Mercurial > pidgin
changeset 11319:d9debf609b79
[gaim-migrate @ 13522]
I'm quite amazed this worked at all. Did no-one notice debug output like this:
Gtk: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
Gtk: gtk_text_buffer_set_mark: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 20 Aug 2005 21:11:57 +0000 |
parents | 519dc2186438 |
children | d3b567926e8f |
files | plugins/spellchk.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/spellchk.c Sat Aug 20 20:17:08 2005 +0000 +++ b/plugins/spellchk.c Sat Aug 20 21:11:57 2005 +0000 @@ -461,7 +461,8 @@ insert_text_after(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, spellchk *spell) { - GtkTextIter start; + GtkTextIter start, end; + GtkTextMark *mark; if (spell->ignore_correction) { spell->ignore_correction = FALSE; @@ -474,7 +475,10 @@ if (len == 1) check_range(spell, buffer, start, *iter); - gtk_text_buffer_move_mark(buffer, spell->mark_insert_end, iter); + /* if check_range modified the buffer, iter has been invalidated */ + mark = gtk_text_buffer_get_insert(buffer); + gtk_text_buffer_get_iter_at_mark(buffer, &end, mark); + gtk_text_buffer_move_mark(buffer, spell->mark_insert_end, &end); spell->inserting = FALSE;