gtksourceview r2118 - in trunk: . gtksourceview
- From: muntyan svn gnome org
- To: svn-commits-list gnome org
- Subject: gtksourceview r2118 - in trunk: . gtksourceview
- Date: Wed, 31 Dec 2008 18:47:28 +0000 (UTC)
Author: muntyan
Date: Wed Dec 31 18:47:28 2008
New Revision: 2118
URL: http://svn.gnome.org/viewvc/gtksourceview?rev=2118&view=rev
Log:
2008-12-31 Yevgen Muntyan <muntyan tamu edu>
* gtksourceview/gtksourcecontextengine.c
(gtk_source_context_engine_text_inserted):
Bug 566131 â Syntax highlightig bug; Backspace and Enter.
Modified:
trunk/ChangeLog
trunk/gtksourceview/gtksourcecontextengine.c
Modified: trunk/gtksourceview/gtksourcecontextengine.c
==============================================================================
--- trunk/gtksourceview/gtksourcecontextengine.c (original)
+++ trunk/gtksourceview/gtksourcecontextengine.c Wed Dec 31 18:47:28 2008
@@ -1670,10 +1670,24 @@
gint start_offset,
gint end_offset)
{
+ GtkTextIter iter;
+ GtkSourceContextEngine *ce = GTK_SOURCE_CONTEXT_ENGINE (engine);
+
g_return_if_fail (start_offset < end_offset);
- invalidate_region (GTK_SOURCE_CONTEXT_ENGINE (engine),
- start_offset,
- end_offset - start_offset);
+
+ /* If end_offset is at the start of a line (enter key pressed) then
+ * we need to invalidate the whole new line, otherwise it may not be
+ * highlighted because the engine analyzes the previous line, end
+ * context there is none, start context at this line is none too,
+ * and the engine stops. */
+ gtk_text_buffer_get_iter_at_offset (ce->priv->buffer, &iter, end_offset);
+ if (gtk_text_iter_starts_line (&iter) && !gtk_text_iter_ends_line (&iter))
+ {
+ gtk_text_iter_forward_to_line_end (&iter);
+ end_offset = gtk_text_iter_get_offset (&iter);
+ }
+
+ invalidate_region (ce, start_offset, end_offset - start_offset);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]