# HG changeset patch # User Daniel Atallah # Date 1195008994 0 # Node ID 27787360371937682f71d6c2e54e12f6edea883a # Parent c8cdf0bcc8e3126fcd41e864b3077cc36731d586 Fix #3930 by correctly detecting when we're no longer immediately following a br. diff -r c8cdf0bcc8e3 -r 277873603719 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Wed Nov 14 00:23:21 2007 +0000 +++ b/pidgin/gtkimhtml.c Wed Nov 14 02:56:34 2007 +0000 @@ -1165,17 +1165,15 @@ static void gtk_imhtml_undo(GtkIMHtml *imhtml) { g_return_if_fail(GTK_IS_IMHTML(imhtml)); - g_return_if_fail(imhtml->editable); - - gtk_source_undo_manager_undo(imhtml->undo_manager); + if (imhtml->editable) + gtk_source_undo_manager_undo(imhtml->undo_manager); } static void gtk_imhtml_redo(GtkIMHtml *imhtml) { g_return_if_fail(GTK_IS_IMHTML(imhtml)); - g_return_if_fail(imhtml->editable); - - gtk_source_undo_manager_redo(imhtml->undo_manager); + if (imhtml->editable) + gtk_source_undo_manager_redo(imhtml->undo_manager); } @@ -2950,8 +2948,10 @@ } else if (imhtml->edit.link == NULL && gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) { GtkIMHtmlFontDetail *fd; - gchar *sml = NULL; + + br = FALSE; + if (fonts) { fd = fonts->data; sml = fd->sml; @@ -2969,6 +2969,7 @@ wpos = 0; ws[0] = 0; } else if (*c == '&' && (amp = purple_markup_unescape_entity(c, &tlen))) { + br = FALSE; while(*amp) { ws [wpos++] = *amp++; } @@ -2997,6 +2998,7 @@ c++; pos++; } else if ((len_protocol = gtk_imhtml_is_protocol(c)) > 0){ + br = FALSE; while(len_protocol--){ /* Skip the next len_protocol characters, but make sure they're copied into the ws array. @@ -3005,6 +3007,7 @@ pos++; } } else if (*c) { + br = FALSE; ws [wpos++] = *c++; pos++; } else {