[gnome-builder/wip/libide] libide: ensure selection iter is up to date



commit 20894db06ad8b525f49330012e2b7238fd0d5286
Author: Christian Hergert <christian hergert me>
Date:   Mon Mar 9 18:25:04 2015 -0700

    libide: ensure selection iter is up to date
    
    Fixes 5j and 5k in normal mode with vim

 libide/ide-source-view-movements.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-source-view-movements.c b/libide/ide-source-view-movements.c
index 172cb70..e31bcf4 100644
--- a/libide/ide-source-view-movements.c
+++ b/libide/ide-source-view-movements.c
@@ -516,6 +516,10 @@ select_to_end:
       else
         gtk_text_buffer_select_range (buffer, &mv->insert, &mv->insert);
     }
+
+  /* make sure selection/insert are up to date */
+  if (!gtk_text_buffer_get_has_selection (buffer))
+    mv->selection = mv->insert;
 }
 
 static void
@@ -582,6 +586,10 @@ ide_source_view_movements_previous_line (Movement *mv)
       else
         gtk_text_buffer_select_range (buffer, &mv->insert, &mv->insert);
     }
+
+  /* make sure selection/insert are up to date */
+  if (!gtk_text_buffer_get_has_selection (buffer))
+    mv->selection = mv->insert;
 }
 
 static void


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