[gtksourceview/gnome-3-24] contextengine: clear invalid ranges if BOM is found
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/gnome-3-24] contextengine: clear invalid ranges if BOM is found
- Date: Sat, 20 Apr 2019 23:55:07 +0000 (UTC)
commit 06a9d3751c808870dc72e470700693d01f4fc284
Author: Christian Hergert <chergert redhat com>
Date: Sat Apr 20 16:52:04 2019 -0700
contextengine: clear invalid ranges if BOM is found
If we came across a BOM at the beginning of a buffer, then we will have
an invalid range before we check for BOM. In that case, we need to to
clear it before we proceed or some assertions (such as invalid range == 1)
will not be met.
Fixes #30
gtksourceview/gtksourcecontextengine.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index f74ec78e..062cca65 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -5381,6 +5381,8 @@ update_syntax (GtkSourceContextEngine *ce,
{
gtk_text_iter_forward_char (&start_iter);
start_offset = gtk_text_iter_get_offset (&start_iter);
+ segment_remove (ce, invalid);
+ CHECK_TREE (ce);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]