[gnome-builder] libide: fix paste position when at line end



commit cff0cbbfb7333a5cbdabb4b0cfd009e1afd9d3fa
Author: Christian Hergert <christian hergert me>
Date:   Mon Mar 9 18:27:32 2015 -0700

    libide: fix paste position when at line end
    
    gtk_text_iter_forward_to_line_end() will swallow the newline if we are
    currently on a newline.
    
    Fixes p in vim mode while at line end.

 libide/ide-source-view.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index b82223d..8c27aa8 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -2184,7 +2184,8 @@ ide_source_view_real_paste_clipboard_extended (IdeSourceView *self,
 
       if (after_cursor)
         {
-          gtk_text_iter_forward_to_line_end (&iter);
+          if (!gtk_text_iter_ends_line (&iter))
+            gtk_text_iter_forward_to_line_end (&iter);
           gtk_text_buffer_select_range (buffer, &iter, &iter);
           g_signal_emit_by_name (self, "insert-at-cursor", "\n");
         }


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