summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-01-18 00:45:50 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-18 00:45:50 +0000
commitc6a3df04741ca1849475d576e6e5b95ddd83c86f (patch)
tree7b2a5c5fe1dcaa8c091cdc4a231a85df0904c2df /gtk
parent6bc31ea4d9bd8250d26af5a0e2fac78b1fe9520a (diff)
downloadgtk+-c6a3df04741ca1849475d576e6e5b95ddd83c86f.tar.gz
change GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
2002-01-17 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work as in the keynav spec, though it makes the interpretation of GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes any sense anyhow.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktextview.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 7f3f79e3b1..10cb65d1e5 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -4457,8 +4457,28 @@ gtk_text_view_move_cursor_internal (GtkTextView *text_view,
break;
case GTK_MOVEMENT_PARAGRAPHS:
- gtk_text_iter_forward_lines (&newplace, count);
- gtk_text_iter_set_line_offset (&newplace, 0);
+ if (count > 0)
+ {
+ if (!gtk_text_iter_ends_line (&newplace))
+ {
+ gtk_text_iter_forward_to_line_end (&newplace);
+ --count;
+ }
+ }
+ else if (count < 0)
+ {
+ if (gtk_text_iter_get_line_offset (&newplace) > 0)
+ {
+ gtk_text_iter_set_line_offset (&newplace, 0);
+ ++count;
+ }
+ }
+
+ if (count != 0)
+ {
+ gtk_text_iter_forward_lines (&newplace, count);
+ gtk_text_iter_set_line_offset (&newplace, 0);
+ }
break;
case GTK_MOVEMENT_PARAGRAPH_ENDS: