im.pidgin.pidgin: 637cd47bbb71fdd54c3b8d186db985dd5ec0d107

datallah at pidgin.im datallah at pidgin.im
Tue Nov 13 22:01:06 EST 2007


-----------------------------------------------------------------
Revision: 637cd47bbb71fdd54c3b8d186db985dd5ec0d107
Ancestor: 9d61f7ce04220ece6fdfa2e89e42f175cf1293c6
Author: datallah at pidgin.im
Date: 2007-11-14T02:56:34
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

Fix #3930 by correctly detecting when we're no longer immediately following a br.

-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	63d59182e41270e0be663e5b59a89af28a33002e
+++ pidgin/gtkimhtml.c	aabd26e9dc6811887d074cd8782f691641149eee
@@ -1165,17 +1165,15 @@ gtk_imhtml_undo(GtkIMHtml *imhtml) {
 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 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 		} else if (imhtml->edit.link == NULL &&
 				gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) {
 			GtkIMHtmlFontDetail *fd;
+			gchar *sml = NULL;
 
-			gchar *sml = NULL;
+			br = FALSE;
+
 			if (fonts) {
 				fd = fonts->data;
 				sml = fd->sml;
@@ -2969,6 +2969,7 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 			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 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 			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 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 				 pos++;
 			}
 		} else if (*c) {
+			br = FALSE;
 			ws [wpos++] = *c++;
 			pos++;
 		} else {


More information about the Commits mailing list