Coloring wrapped quotes



Issue: Balsa decides on the color for displaying a line after wrapping it,
and since any wrapped fragment lacks the distinguishing initial string it
isn't colored.
Patch: Wrap each line after deciding on the color, instead of wrapping the
whole message up-front. Patch against 1.1.6 attached.
diff -Naur balsa-1.1.5/src/balsa-message.c balsa-1.1.5-patched/src/balsa-message.c
--- balsa-1.1.5/src/balsa-message.c	Mon May 21 12:33:25 2001
+++ balsa-1.1.5-patched/src/balsa-message.c	Tue May 22 19:54:01 2001
@@ -1318,9 +1318,6 @@
 	
 	fnt = find_body_font(info->body);
 
-	if (bm->wrap_text)
-	    libbalsa_wrap_string(ptr, balsa_app.wraplength);
-	
 	if (!fnt)
 	    fnt = gdk_fontset_load(balsa_app.message_font);
 	
@@ -1351,6 +1348,8 @@
 	if (regcomp(&rex, balsa_app.quote_regex, REG_EXTENDED) != 0) {
 	    g_warning
 		("part_info_init_mimetext: quote regex compilation failed.");
+	    if (bm->wrap_text)
+	        libbalsa_wrap_string(ptr, balsa_app.wraplength);
 	    gtk_text_insert(GTK_TEXT(item), fnt, NULL, NULL, ptr, -1);
 	} else {
 	    gint ypos = 0;
@@ -1358,6 +1357,8 @@
 	    lines = l = g_strsplit(ptr, "\n", -1);
 	    for (line = *lines; line != NULL; line = *(++lines)) {
 		line = g_strconcat(line, "\n", NULL);
+	        if (bm->wrap_text)
+	            libbalsa_wrap_string(line, balsa_app.wraplength);
 		quote_level = is_a_quote(line, &rex);
 		if (quote_level != 0) {
 		    /* Modulus the quote level by the max,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]