KEYNAV:GtkTextView



I was looking at bug 53934 and have come up with the following change to 
implement using Ctrl+Up/Down to move the cursor to the beginning of the 
previous/next paragraph.

Can I commit this?

Padraig

===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.109
diff -u -p -r1.109 gtktextview.c
--- gtktextview.c       2001/09/11 04:27:53     1.109
+++ gtktextview.c       2001/09/12 10:51:07
@@ -763,6 +763,18 @@ gtk_text_view_class_init (GtkTextViewCla
   add_move_binding (binding_set, GDK_n, GDK_CONTROL_MASK,
                     GTK_MOVEMENT_DISPLAY_LINES, 1);
 
+  add_move_binding (binding_set, GDK_Up, GDK_CONTROL_MASK,
+                    GTK_MOVEMENT_PARAGRAPHS, -1);
+
+  add_move_binding (binding_set, GDK_KP_Up, GDK_CONTROL_MASK,
+                    GTK_MOVEMENT_PARAGRAPHS, -1);
+  
+  add_move_binding (binding_set, GDK_Down, GDK_CONTROL_MASK,
+                    GTK_MOVEMENT_PARAGRAPHS, 1);
+
+  add_move_binding (binding_set, GDK_KP_Down, GDK_CONTROL_MASK,
+                    GTK_MOVEMENT_PARAGRAPHS, 1);
+  
   add_move_binding (binding_set, GDK_a, GDK_CONTROL_MASK,
                     GTK_MOVEMENT_PARAGRAPH_ENDS, -1);
 
@@ -3914,9 +3926,11 @@ gtk_text_view_move_cursor (GtkTextView  
       break;
 
     case GTK_MOVEMENT_PARAGRAPHS:
-      /* This should almost certainly instead be doing the parallel thing to 
WORD */
-      /*       gtk_text_iter_down_lines (&newplace, count); */
-      /* FIXME */
+      if (count < 0)
+        gtk_text_iter_backward_lines (&newplace, -count);
+      else if (count > 0)
+        gtk_text_iter_forward_lines (&newplace, count);
+      gtk_text_iter_set_line_offset (&newplace, 0);
       break;
 
     case GTK_MOVEMENT_PARAGRAPH_ENDS:





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]