sync with 0.8.1cvs26
authorPaul Mangan <paul@claws-mail.org>
Wed, 21 Aug 2002 06:43:46 +0000 (06:43 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 21 Aug 2002 06:43:46 +0000 (06:43 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c

index 697ba9bae52f74a24c61f51fc9e5fca23dc6db72..ccf4b5cb3a16f0d5267445356caa3747150fceb1 100644 (file)
--- 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
index 74ce72465389e552ae0b2fc01cd9964660c4f44d..6debfb963ee70ea59ffc194c312331ce43172bb3 100644 (file)
@@ -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
index f210dd2423984ae67b0aa4108b7e92cf4baa4f77..3b11032c6798505293a0a08341a781aa1c143bea 100644 (file)
@@ -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 ¤µ¤ó¤Ë¤è¤Ã¤ÆÊó¹ð
index 39444895be1497295a3580f8fb316e16c8e3690b..920e19833672e3f50a26412fb7e50866fb66ada6 100644 (file)
@@ -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
index 7b106fa5358e1880448f51f1950d9f259a052f56..268bb78f0b6fa3a21d6369c7b54894bd7272b1d3 100644 (file)
@@ -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