Ctrl-Home / Ctrl-End have proper cursor navigation
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Wed, 9 May 2001 18:11:04 +0000 (18:11 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Wed, 9 May 2001 18:11:04 +0000 (18:11 +0000)
ChangeLog.claws
src/gtkstext.c

index 03a03082fc33bc9cec80d6fb51ffa04127c2badc..e040e786417c76822e451767cfe19fda8d27ad21 100644 (file)
@@ -1,4 +1,10 @@
+2001-05-09 [alfons]
+
+       * src/gtkstext.c:
+               Ctrl-Home / Ctrl-End have proper cursor navigation
+
 2001-05-09 [hoa]
+
        * src/prefs_matcher.c
                finished UI to define matching properties
                added ok and cancel button
index a46b3def0f7c2e049f752a6059a73f57c04c7562..e4ca82ff111faaa3f761314c0733189548b6e194 100644 (file)
@@ -2189,8 +2189,17 @@ gtk_stext_key_press (GtkWidget   *widget,
       switch (event->keyval)
        {
        case GDK_Home:
-         if (event->state & GDK_CONTROL_MASK)
-           move_cursor_buffer_ver (text, -1);
+         if (event->state & GDK_CONTROL_MASK) {
+               if (text->wrap_rmargin == 0) {
+                       /* SYLPHEED: old behaviour */
+                       move_cursor_buffer_ver (text, -1);
+               }
+               else {
+                       /* SYLPHEED: contrived, but "trusty" */
+                       move_cursor_buffer_ver(text, -1);
+                       move_cursor_to_display_row_start(text);
+               }
+         }     
          else {
                if (text->wrap_rmargin > 0) {
                        /* SYLPHEED: line start */
@@ -2202,8 +2211,17 @@ gtk_stext_key_press (GtkWidget   *widget,
          }     
          break;
        case GDK_End:
-         if (event->state & GDK_CONTROL_MASK)
-           move_cursor_buffer_ver (text, +1);
+         if (event->state & GDK_CONTROL_MASK) {
+               /* SYLPHEED: a little bit contrived... */
+               if (text->wrap_rmargin == 0) {
+                       /* old behaviour */
+                       move_cursor_buffer_ver (text, +1);
+               }
+               else {
+                       move_cursor_buffer_ver(text, +1);
+                       move_cursor_to_display_row_end(text);
+               }
+         }             
          else {
                if (text->wrap_rmargin > 0) {
                        /* SYLPHEED: line end */