[gnome-builder/wip/vim] editor: only adjust the beginning iter when (un)indenting.



commit 5f35ac256f1bccdc23aff6a9be828cabf398fe33
Author: Christian Hergert <christian hergert me>
Date:   Tue Sep 30 12:26:24 2014 -0700

    editor: only adjust the beginning iter when (un)indenting.

 src/editor/gb-source-view.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/editor/gb-source-view.c b/src/editor/gb-source-view.c
index e2d8fe5..c567295 100644
--- a/src/editor/gb-source-view.c
+++ b/src/editor/gb-source-view.c
@@ -206,13 +206,10 @@ gb_source_view_indent_selection (GbSourceView *view)
   gtk_text_buffer_get_selection_bounds (priv->buffer, &begin, &end);
 
   /*
-   * Expand the iters to the beginning of the first line and the
-   * end of the last line.
+   * Expand the iters to the beginning of the first line.
    */
   while (!gtk_text_iter_starts_line (&begin))
     gtk_text_iter_backward_char (&begin);
-  while (!gtk_text_iter_ends_line (&end))
-    gtk_text_iter_forward_char (&end);
 
   /*
    * Set marks so we can track our end position after every edit.
@@ -296,13 +293,10 @@ gb_source_view_unindent_selection (GbSourceView *view)
   gtk_text_buffer_get_selection_bounds (priv->buffer, &begin, &end);
 
   /*
-   * Expand the iters to the beginning of the first line and the
-   * end of the last line.
+   * Adjust the starting iter to include the whole line.
    */
   while (!gtk_text_iter_starts_line (&begin))
     gtk_text_iter_backward_char (&begin);
-  while (!gtk_text_iter_ends_line (&end))
-    gtk_text_iter_forward_char (&end);
 
   /*
    * Set marks so we can track our end position after every edit.


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