[gtksourceview] Make sure to not get stuck if there are invisble chars



commit 0644c1f4d40dc4cb1ce0b7c32b2d15d7122e552c
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun May 16 23:35:22 2010 +0200

    Make sure to not get stuck if there are invisble chars

 gtksourceview/gtksourceview.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3a305c9..01341ae 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2018,9 +2018,16 @@ move_to_first_char (GtkTextView *text_view,
 		c = gtk_text_iter_get_char (iter);
 
 		if (g_unichar_isspace (c))
-			gtk_text_iter_forward_visible_cursor_position (iter);
+		{
+			if (!gtk_text_iter_forward_visible_cursor_position (iter))
+			{
+				break;
+			}
+		}
 		else
+		{
 			break;
+		}
 	}
 }
 
@@ -2052,7 +2059,11 @@ move_to_last_char (GtkTextView *text_view,
 	{
 		gunichar c;
 
-		gtk_text_iter_backward_visible_cursor_position (iter);
+		if (!gtk_text_iter_backward_visible_cursor_position (iter))
+		{
+			break;
+		}
+
 		c = gtk_text_iter_get_char (iter);
 
 		if (!g_unichar_isspace (c))



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