aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-12 12:30:20 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-12 12:30:20 +0000
commitb3893bb06bae9fa9b3ccbd65ecfe6cada9135924 (patch)
tree1e4ae9392b03d2fbf398cd973ad1fa48535a8d69 /src/compose.c
parent67bce9ecfaaeceb8c37fac7f22a447917c8c6a1c (diff)
don't break line after '-'.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@425 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/compose.c b/src/compose.c
index 9204c0ef..31827999 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -2062,6 +2062,7 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
gint pos = 0;
gboolean can_break = FALSE;
gboolean do_break = FALSE;
+ gboolean prev_hyphen = FALSE;
gtk_text_iter_forward_to_line_end(&line_end);
str = gtk_text_buffer_get_text(buffer, &iter, &line_end, FALSE);
@@ -2095,7 +2096,7 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
gunichar wc;
gint uri_len;
- if (attr->is_line_break && can_break)
+ if (attr->is_line_break && can_break && !prev_hyphen)
pos = i;
/* don't wrap URI */
@@ -2112,9 +2113,11 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
}
wc = g_utf8_get_char(p);
- if (g_unichar_iswide(wc))
+ if (g_unichar_iswide(wc)) {
col += 2;
- else if (*p == '\t')
+ if (prev_hyphen && can_break && attr->is_line_break)
+ pos = i;
+ } else if (*p == '\t')
col += 8;
else
col++;
@@ -2123,6 +2126,11 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
break;
}
+ if (*p == '-')
+ prev_hyphen = TRUE;
+ else
+ prev_hyphen = FALSE;
+
p = g_utf8_next_char(p);
can_break = TRUE;
}