[gtksourceview] Fix logical bug introduced in the BOM patch



commit 45857f255a4ac291b712d62cf5847b17944f8f48
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Jun 19 15:29:17 2010 +0200

    Fix logical bug introduced in the BOM patch

 gtksourceview/gtksourcecontextengine.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index b3666af..448975e 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -5904,11 +5904,16 @@ update_syntax (GtkSourceContextEngine *ce,
 #endif
 
 		if (first_line)
+		{
 			state = ce->priv->root_segment;
+		}
 		else
+		{
 			state = get_segment_at_offset (ce,
 						       ce->priv->hint ? ce->priv->hint : state,
 						       line_start_offset - 1);
+		}
+
 		g_assert (state->context != NULL);
 
 		ce->priv->hint2 = ce->priv->hint;
@@ -6002,6 +6007,8 @@ update_syntax (GtkSourceContextEngine *ce,
 			gtk_text_iter_forward_line (&line_end);
 			line_end_offset = gtk_text_iter_get_offset (&line_end);
 		}
+
+		first_line = (0 == line_start_offset);
 	}
 
 	if (analyzed_end == gtk_text_buffer_get_char_count (buffer))



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