2005-12-19 [cleroy] 1.9.100cvs95
authorColin Leroy <colin@colino.net>
Mon, 19 Dec 2005 19:25:35 +0000 (19:25 +0000)
committerColin Leroy <colin@colino.net>
Mon, 19 Dec 2005 19:25:35 +0000 (19:25 +0000)
* src/compose.c
* src/compose.h
Don't automatically join lines when they've
been separated by the user and not automatically

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/compose.h

index d910de6..a6af36b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-19 [cleroy]    1.9.100cvs95
+
+       * src/compose.c
+       * src/compose.h
+               Don't automatically join lines when they've 
+               been separated by the user and not automatically
+
 2005-12-19 [paul]      1.9.100cvs94
 
        * src/gtk/pluginwindow.c
index 5dbded4..afde9ec 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.206 -r 1.382.2.207 src/compose.c;  ) > 1.9.100cvs92.patchset
 ( cvs diff -u -r 1.13.2.11 -r 1.13.2.12 src/common/plugin.c;  cvs diff -u -r 1.5.2.2 -r 1.5.2.3 src/common/plugin.h;  cvs diff -u -r 1.5.2.21 -r 1.5.2.22 src/gtk/pluginwindow.c;  cvs diff -u -r 1.13.2.18 -r 1.13.2.19 src/plugins/clamav/clamav_plugin.c;  cvs diff -u -r 1.13.2.4 -r 1.13.2.5 src/plugins/demo/demo.c;  cvs diff -u -r 1.12.2.9 -r 1.12.2.10 src/plugins/dillo_viewer/dillo_viewer.c;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/plugins/pgpcore/plugin.c;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/pgpinline/plugin.c;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/plugins/pgpmime/plugin.c;  cvs diff -u -r 1.18.2.15 -r 1.18.2.16 src/plugins/spamassassin/spamassassin.c;  cvs diff -u -r 1.14.2.29 -r 1.14.2.30 src/plugins/trayicon/trayicon.c;  ) > 1.9.100cvs93.patchset
 ( cvs diff -u -r 1.5.2.22 -r 1.5.2.23 src/gtk/pluginwindow.c;  ) > 1.9.100cvs94.patchset
+( cvs diff -u -r 1.382.2.207 -r 1.382.2.208 src/compose.c;  cvs diff -u -r 1.50.2.17 -r 1.50.2.18 src/compose.h;  ) > 1.9.100cvs95.patchset
index c35f2f0..40400d1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=94
+EXTRA_VERSION=95
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 77614a5..24e6525 100644 (file)
@@ -817,6 +817,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
                                         "foreground-gdk", &uri_color,
                                         NULL);
        compose->no_wrap_tag = gtk_text_buffer_create_tag(buffer, "no_wrap", NULL);
+       compose->no_join_tag = gtk_text_buffer_create_tag(buffer, "no_join", NULL);
 }
 
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
@@ -3187,8 +3188,14 @@ static gboolean compose_join_next_line(Compose *compose,
        if (quote_len > 0)
                gtk_text_buffer_delete(buffer, &iter_, &end);
 
-       /* delete linebreak and extra spaces */
+       /* don't join line breaks put by the user */
        prev = cur = iter_;
+       gtk_text_iter_backward_char(&cur);
+       if (gtk_text_iter_has_tag(&cur, compose->no_join_tag)) {
+               return FALSE;
+       }
+       gtk_text_iter_forward_char(&cur);
+       /* delete linebreak and extra spaces */
        while (gtk_text_iter_backward_char(&cur)) {
                wc1 = gtk_text_iter_get_char(&cur);
                if (!g_unichar_isspace(wc1))
@@ -8091,9 +8098,14 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
                                  
                gtk_text_buffer_get_iter_at_mark(buffer, iter, mark);
                gtk_text_buffer_place_cursor(buffer, iter);
-       } else
-               gtk_text_buffer_insert(buffer, iter, text, len);
-
+       } else {
+               if (strcmp(text, "\n"))
+                       gtk_text_buffer_insert(buffer, iter, text, len);
+               else
+                       gtk_text_buffer_insert_with_tags_by_name(buffer, 
+                               iter, text, len, "no_join", NULL);
+       }
+       
        mark = gtk_text_buffer_create_mark(buffer, NULL, iter, FALSE);
        
        compose_beautify_paragraph(compose, iter, FALSE);
index 231d58c..67913c0 100644 (file)
@@ -216,6 +216,7 @@ struct _Compose
        guint draft_timeout_tag;
        
        GtkTextTag *no_wrap_tag;
+       GtkTextTag *no_join_tag;
        GMutex *mutex;
        gchar *orig_charset;
        gint set_cursor_pos;