Re: Coloring wrapped quotes



On 2001.06.20 17:02 Peter Bloomfield wrote:
> 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.

Oops--wrong patch--that one was against 1.1.5!  Current patch attached.
diff -Nur balsa-uninit/src/balsa-message.c balsa-work/src/balsa-message.c
--- balsa-uninit/src/balsa-message.c	Wed Jun 20 14:55:38 2001
+++ balsa-work/src/balsa-message.c	Wed Jun 20 16:41:40 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;
@@ -1359,6 +1358,9 @@
 	    for (line = *lines; line != NULL; line = *(++lines)) {
 		line = g_strconcat(line, "\n", NULL);
 		quote_level = is_a_quote(line, &rex);
+		if (bm->wrap_text)
+		    libbalsa_wrap_string(line, balsa_app.wraplength);
+	
 		if (quote_level != 0) {
 		    /* Modulus the quote level by the max,
 		     * ie, always have "1 <= quote level <= MAX"


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