commit d2c9053314da34ee57bc0bf9cf230017159171b9
parent 86db8424877fd6c4eb81b9344931defec181a976
Author: Colin Leroy <colin@colino.net>
Date: Mon, 16 Jun 2008 15:45:09 +0000
2008-06-16 [colin] 3.4.0cvs99
* src/compose.c
Fix cursor placing on signature change
Diffstat:
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-16 [colin] 3.4.0cvs99
+
+ * src/compose.c
+ Fix cursor placing on signature change
+
2008-06-16 [paul] 3.4.0cvs98
* src/imap_gtk.c
diff --git a/PATCHSETS b/PATCHSETS
@@ -3394,3 +3394,4 @@
( cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/autofaces.c; cvs diff -u -r 1.1.4.52 -r 1.1.4.53 src/prefs_filtering_action.c; ) > 3.4.0cvs96.patchset
( cvs diff -u -r 1.155.2.88 -r 1.155.2.89 src/Makefile.am; ) > 3.4.0cvs97.patchset
( cvs diff -u -r 1.1.2.57 -r 1.1.2.58 src/imap_gtk.c; cvs diff -u -r 1.2.2.31 -r 1.2.2.32 src/mh_gtk.c; cvs diff -u -r 1.2.2.28 -r 1.2.2.29 src/gtk/inputdialog.c; ) > 3.4.0cvs98.patchset
+( cvs diff -u -r 1.382.2.453 -r 1.382.2.454 src/compose.c; ) > 3.4.0cvs99.patchset
diff --git a/configure.ac b/configure.ac
@@ -11,7 +11,7 @@ MINOR_VERSION=4
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=98
+EXTRA_VERSION=99
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/compose.c b/src/compose.c
@@ -3233,7 +3233,7 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
GtkTextMark *mark;
GtkTextIter iter, iter_end;
- gint cur_pos;
+ gint cur_pos, ins_pos;
gboolean prev_autowrap;
gboolean found = FALSE;
gboolean exists = FALSE;
@@ -3249,6 +3249,7 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
mark = gtk_text_buffer_get_insert(buffer);
gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
cur_pos = gtk_text_iter_get_offset (&iter);
+ ins_pos = cur_pos;
gtk_text_buffer_get_end_iter(buffer, &iter);
@@ -3306,10 +3307,11 @@ 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);
}
+
/* put the cursor where it should be
- * either where the quote_fmt says, either before the signature */
+ * either where the quote_fmt says, either where it was */
if (compose->set_cursor_pos < 0)
- gtk_text_buffer_get_iter_at_offset(buffer, &iter, cur_pos);
+ gtk_text_buffer_get_iter_at_offset(buffer, &iter, ins_pos);
else
gtk_text_buffer_get_iter_at_offset(buffer, &iter,
compose->set_cursor_pos);