[gtksourceview] Fix smart-home-end for end of buffer



commit 64e3fb7058cda1ae5d391532bf9a79204999e575
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun May 16 23:21:06 2010 +0200

    Fix smart-home-end for end of buffer
    
    There seems to be a bug in forward_visible_cursor_position where
    it won't move to the end of the buffer.

 gtksourceview/gtksourceview.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 35e16fc..5a85e31 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2058,7 +2058,13 @@ move_to_last_char (GtkTextView *text_view,
 		if (!g_unichar_isspace (c))
 		{
 			/* We've gone one cursor position too far. */
-			gtk_text_iter_forward_visible_cursor_position (iter);
+			if (!gtk_text_iter_forward_visible_cursor_position (iter))
+			{
+				/* There is some kind of bug where it won't move
+				   to the last cursor position... */
+				gtk_text_iter_forward_to_end (iter);
+			}
+
 			break;
 		}
 	}



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