[gnome-builder] movements: scroll full left for first char movements



commit 4a9f99c5b6c6eb5fbd090952ed2b621e65bb98be
Author: Christian Hergert <chergert redhat com>
Date:   Wed Nov 8 14:20:39 2017 -0800

    movements: scroll full left for first char movements
    
    If we are trying to go to the semantic beginning of a line, we should try
    harder to ensure that we make the first real column visible.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789947

 src/libide/sourceview/ide-source-view-movements.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view-movements.c 
b/src/libide/sourceview/ide-source-view-movements.c
index 83d8bad..b4af229 100644
--- a/src/libide/sourceview/ide-source-view-movements.c
+++ b/src/libide/sourceview/ide-source-view-movements.c
@@ -1947,6 +1947,7 @@ _ide_source_view_apply_movement (IdeSourceView         *self,
   GtkTextIter end_iter;
   GtkTextIter before_insert;
   GtkTextIter after_insert;
+  gdouble xalign = 0.5;
   gint min_count = 1;
   gint end_line;
   gint distance;
@@ -2031,11 +2032,13 @@ _ide_source_view_apply_movement (IdeSourceView         *self,
     case IDE_SOURCE_VIEW_MOVEMENT_FIRST_CHAR:
       mv.count = MAX (1, mv.count);
       ide_source_view_movements_first_char (&mv);
+      xalign = 1.0;
       break;
 
     case IDE_SOURCE_VIEW_MOVEMENT_FIRST_NONSPACE_CHAR:
       mv.count = MAX (1, mv.count);
       ide_source_view_movements_first_nonspace_char (&mv);
+      xalign = 1.0;
       break;
 
     case IDE_SOURCE_VIEW_MOVEMENT_MIDDLE_CHAR:
@@ -2330,7 +2333,7 @@ _ide_source_view_apply_movement (IdeSourceView         *self,
     ide_source_view_get_visual_position (mv.self, &line, target_column);
 
   if (!mv.ignore_scroll_to_insert)
-    ide_source_view_scroll_mark_onscreen (self, insert, TRUE, 0.5, 0.5);
+    ide_source_view_scroll_mark_onscreen (self, insert, TRUE, xalign, 0.5);
 
   /* Emit a jump if we moved more than JUMP_THRESHOLD lines */
   gtk_text_buffer_get_iter_at_mark (buffer, &after_insert, insert);


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