2005-12-05 [colin] 1.9.100cvs67
authorColin Leroy <colin@colino.net>
Mon, 5 Dec 2005 17:13:45 +0000 (17:13 +0000)
committerColin Leroy <colin@colino.net>
Mon, 5 Dec 2005 17:13:45 +0000 (17:13 +0000)
* src/compose.c
* src/compose.h
Fix cursor positioning (not obeying %X)

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

index ae9b793..4da70ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-05 [colin]     1.9.100cvs67
+
+       * src/compose.c
+       * src/compose.h
+               Fix cursor positioning (not obeying %X)
+
 2005-12-05 [paul]      1.9.100cvs66
 
        * src/plugins/dillo_viewer/dillo_prefs.c
index 77670ef..4bdef5d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.8.2.6 -r 1.8.2.7 README;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/plugins.xml;  ) > 1.9.100cvs64.patchset
 ( cvs diff -u -r 1.5.2.16 -r 1.5.2.17 src/prefs_spelling.c;  cvs diff -u -r 1.14.2.27 -r 1.14.2.28 src/plugins/trayicon/trayicon.c;  ) > 1.9.100cvs65.patchset
 ( cvs diff -u -r 1.5.2.9 -r 1.5.2.10 src/plugins/dillo_viewer/dillo_prefs.c;  ) > 1.9.100cvs66.patchset
+( cvs diff -u -r 1.382.2.200 -r 1.382.2.201 src/compose.c;  cvs diff -u -r 1.50.2.15 -r 1.50.2.16 src/compose.h;  ) > 1.9.100cvs67.patchset
index 95558aa..e15c557 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=66
+EXTRA_VERSION=67
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index abb9a0c..f9d5442 100644 (file)
@@ -2184,7 +2184,7 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
        gtk_text_buffer_get_start_iter(buffer, &iter);
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, cursor_pos);
        gtk_text_buffer_place_cursor(buffer, &iter);
-       
+       compose->set_cursor_pos = cursor_pos;
 
        compose->autowrap = prev_autowrap;
        if (compose->autowrap)
@@ -2527,9 +2527,15 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
        if (cur_pos > gtk_text_buffer_get_char_count (buffer))
                cur_pos = gtk_text_buffer_get_char_count (buffer);
 
-       gtk_text_buffer_get_iter_at_offset(buffer, &iter, cur_pos);
+       /* put the cursor where it should be 
+        * either where the quote_fmt says, either before the signature */
+       if (compose->set_cursor_pos <= 0)
+               gtk_text_buffer_get_iter_at_offset(buffer, &iter, cur_pos);
+       else
+               gtk_text_buffer_get_iter_at_offset(buffer, &iter, 
+                       compose->set_cursor_pos);
+               
        gtk_text_buffer_place_cursor(buffer, &iter);
-
        g_signal_handlers_unblock_by_func(G_OBJECT(buffer),
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
@@ -5310,7 +5316,8 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        compose->account = account;
        
        compose->mutex = g_mutex_new();
-       
+       compose->set_cursor_pos = -1;
+
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
        gtk_widget_set_size_request(window, -1, prefs_common.compose_height);
@@ -6031,6 +6038,7 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
                gtk_text_buffer_get_start_iter(buffer, &iter);
                gtk_text_buffer_get_iter_at_offset(buffer, &iter, cursor_pos);
                gtk_text_buffer_place_cursor(buffer, &iter);
+               compose->set_cursor_pos = cursor_pos;
        }
 
        if (parsed_str)
index d8b9ab2..31819f2 100644 (file)
@@ -218,6 +218,7 @@ struct _Compose
        GtkTextTag *no_wrap_tag;
        GMutex *mutex;
        gchar *orig_charset;
+       gint set_cursor_pos;
 };
 
 struct _AttachInfo