[Commits] [SCM] claws branch, master, updated. 3.17.3-35-gf4f722b

ticho at claws-mail.org ticho at claws-mail.org
Sun Jan 6 11:25:35 CET 2019


The branch, master has been updated
       via  f4f722b814ad7ff6f3fa6cb5e83b330275784d97 (commit)
      from  0b510383802dc6d6a70cf3897b7293799c1ba570 (commit)

Summary of changes:
 src/compose.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit f4f722b814ad7ff6f3fa6cb5e83b330275784d97
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Jan 6 11:23:19 2019 +0100

    Improve line breaks in compose window
    
    Fixes bug #3070: misbehaving text wrapping when URL chars are present

diff --git a/src/compose.c b/src/compose.c
index 8d8e097..d2ca99c 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -4256,10 +4256,16 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
 
 	for (; *p != '\0' && i < len; i++) {
 		PangoLogAttr *attr = attrs + i;
-		gunichar wc;
+		gunichar wc = g_utf8_get_char(p);
 		gint uri_len;
 
-		if (attr->is_line_break && can_break && was_white && !prev_dont_break)
+		/* attr->is_line_break will be false for some characters that
+		 * we want to break a line before, like '/' or ':', so we
+		 * also allow breaking on any non-wide character. The
+		 * mentioned pango attribute is still useful to decide on
+		 * line breaks when wide characters are involved. */
+		if ((!g_unichar_iswide(wc) || attr->is_line_break)
+				&& can_break && was_white && !prev_dont_break)
 			pos = i;
 		
 		was_white = attr->is_white;
@@ -4277,7 +4283,6 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
 			continue;
 		}
 
-		wc = g_utf8_get_char(p);
 		if (g_unichar_iswide(wc)) {
 			col += 2;
 			if (prev_dont_break && can_break && attr->is_line_break)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list