From: Paul Mangan Date: Wed, 21 Aug 2002 06:43:46 +0000 (+0000) Subject: sync with 0.8.1cvs26 X-Git-Tag: rel_0_8_2~46 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=28498f7364740dc15b1f83e98c4c0d7d9dd20a59 sync with 0.8.1cvs26 --- diff --git a/ChangeLog b/ChangeLog index 697ba9bae..ccf4b5cb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-08-21 + + * src/compose.c: compose_wrap_line_all(): fix for auto-wrapping + (go to next line when space is entered at line limit). + 2002-08-19 * src/inc.c: inc_get_uidl_table(): fixed a memory leak reported by diff --git a/ChangeLog.claws b/ChangeLog.claws index 74ce72465..6debfb963 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2002-08-21 [paul] 0.8.1claws87 + + * sync with 0.8.1cvs26 + see ChangeLog 2002-08-21 + 2002-08-20 [christoph] 0.8.1claws86 * src/folderview.c diff --git a/ChangeLog.jp b/ChangeLog.jp index f210dd242..3b11032c6 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,8 @@ +2002-08-21 + + * src/compose.c: compose_wrap_line_all(): ¼«Æ°²þ¹Ô¤Î¤¿¤á¤Î½¤Àµ + (¹Ô¤Î¾å¸Â°ÌÃ֤ǶõÇò¤¬ÆþÎϤµ¤ì¤¿¤é¼¡¤Î¹Ô¤Ë°ÜÆ°)¡£ + 2002-08-19 * src/inc.c: inc_get_uidl_table(): Martin Kluge ¤µ¤ó¤Ë¤è¤Ã¤ÆÊó¹ð diff --git a/configure.in b/configure.in index 39444895b..920e19833 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=8 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws86 +EXTRA_VERSION=claws87 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/compose.c b/src/compose.c index 7b106fa53..268bb78f0 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2352,15 +2352,14 @@ static void compose_wrap_line_all(Compose *compose) gboolean is_new_line = TRUE, do_delete = FALSE; guint i_len = 0; gboolean linewrap_quote = TRUE; + gboolean set_editable_pos = FALSE; + gint editable_pos = 0; guint linewrap_len = prefs_common.linewrap_len; gchar *qfmt = prefs_common.quotemark; gchar cbuf[MB_LEN_MAX]; gtk_stext_freeze(text); - /* make text buffer contiguous */ - /* gtk_stext_compact_buffer(text); */ - tlen = gtk_stext_get_length(text); for (; cur_pos < tlen; cur_pos++) { @@ -2372,7 +2371,7 @@ static void compose_wrap_line_all(Compose *compose) is_new_line = FALSE; p_pos = cur_pos; #ifdef WRAP_DEBUG - printf("new line i_len=%d p_pos=", i_len); + g_print("new line i_len=%d p_pos=", i_len); dump_text(text, p_pos, tlen, 1); #endif } @@ -2385,7 +2384,7 @@ static void compose_wrap_line_all(Compose *compose) guint tab_offset = line_len % tab_width; #ifdef WRAP_DEBUG - printf("found tab at pos=%d line_len=%d ", cur_pos, + g_print("found tab at pos=%d line_len=%d ", cur_pos, line_len); #endif if (tab_offset) { @@ -2410,7 +2409,7 @@ static void compose_wrap_line_all(Compose *compose) do_delete = FALSE; #ifdef WRAP_DEBUG - printf("found CR at %d do_del is %d next line is ", + g_print("found CR at %d do_del is %d next line is ", cur_pos, do_delete); dump_text(text, cur_pos + 1, tlen, 1); #endif @@ -2421,7 +2420,7 @@ static void compose_wrap_line_all(Compose *compose) do_delete = FALSE; #ifdef WRAP_DEBUG - printf("l_len=%d wrap_len=%d do_del=%d\n", + g_print("l_len=%d wrap_len=%d do_del=%d\n", line_len, linewrap_len, do_delete); #endif /* should we delete to perform smart wrapping */ @@ -2452,7 +2451,6 @@ static void compose_wrap_line_all(Compose *compose) ((clen > 1) || isalnum(cb[0]))) { gtk_stext_insert(text, NULL, NULL, NULL, " ", 1); - /* gtk_stext_compact_buffer(text); */ tlen++; } @@ -2463,7 +2461,7 @@ static void compose_wrap_line_all(Compose *compose) do_delete = FALSE; is_new_line = TRUE; #ifdef WRAP_DEBUG - printf("after delete l_pos="); + g_print("after delete l_pos="); dump_text(text, line_pos, tlen, 1); #endif continue; @@ -2493,7 +2491,7 @@ static void compose_wrap_line_all(Compose *compose) gint clen; #ifdef WRAP_DEBUG - printf("should wrap cur_pos=%d ", cur_pos); + g_print("should wrap cur_pos=%d ", cur_pos); dump_text(text, p_pos, tlen, 1); dump_text(text, line_pos, tlen, 1); #endif @@ -2503,16 +2501,23 @@ static void compose_wrap_line_all(Compose *compose) (text, line_pos, tlen)) line_pos = cur_pos - 1; #ifdef WRAP_DEBUG - printf("new line_pos=%d\n", line_pos); + g_print("new line_pos=%d\n", line_pos); #endif GET_CHAR(line_pos - 1, cbuf, clen); /* if next character is space delete it */ - if (clen == 1 && isspace(*cbuf)) { + if (clen == 1 && isspace(*cbuf)) { if (p_pos + i_len != line_pos || !gtkut_stext_is_uri_string (text, line_pos, tlen)) { + /* workaround for correct cursor + position */ + if (set_editable_pos == FALSE) { + editable_pos = gtk_editable_get_position(GTK_EDITABLE(text)); + if (editable_pos == line_pos) + set_editable_pos = TRUE; + } gtk_stext_set_point(text, line_pos); gtk_stext_backward_delete(text, 1); tlen--; @@ -2527,7 +2532,7 @@ static void compose_wrap_line_all(Compose *compose) if (p_pos + i_len == line_pos && gtkut_stext_is_uri_string(text, line_pos, tlen)) { #ifdef WRAP_DEBUG - printf("found URL at "); + g_print("found URL at "); dump_text(text, line_pos, tlen, 1); #endif continue; @@ -2550,7 +2555,7 @@ static void compose_wrap_line_all(Compose *compose) else do_delete = FALSE; #ifdef WRAP_DEBUG - printf("after CR insert "); + g_print("after CR insert "); dump_text(text, line_pos, tlen, 1); dump_text(text, cur_pos, tlen, 1); #endif @@ -2571,7 +2576,7 @@ static void compose_wrap_line_all(Compose *compose) tlen += ins_len; } #ifdef WRAP_DEBUG - printf("after quote insert "); + g_print("after quote insert "); dump_text(text, line_pos, tlen, 1); #endif } @@ -2588,6 +2593,9 @@ static void compose_wrap_line_all(Compose *compose) } gtk_stext_thaw(text); + + if (set_editable_pos && editable_pos <= tlen) + gtk_editable_set_position(GTK_EDITABLE(text), editable_pos); } #undef GET_CHAR