Patch gtksourceview for files with BOM

This commit is contained in:
Alberto Fanjul 2019-04-20 10:47:34 +02:00
parent d8a198ab2f
commit 54e422839f
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,27 @@
From 4ffc03c56540e5920f2701bb9342773f19d599e4 Mon Sep 17 00:00:00 2001
From: Alberto Fanjul <albertofanjul@gmail.com>
Date: Sat, 20 Apr 2019 11:28:00 +0200
Subject: [PATCH] Allow up to 2 invalid segments
Seems files with BOM cause this situation, but there's no other
side effect
---
gtksourceview/gtksourcecontextengine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index f74ec78e..2d00f171 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -5540,7 +5540,7 @@ update_syntax (GtkSourceContextEngine *ce,
if (analyzed_end == gtk_text_buffer_get_char_count (buffer))
{
- g_assert (g_slist_length (ce->priv->invalid) <= 1);
+ g_assert (g_slist_length (ce->priv->invalid) <= 2);
if (ce->priv->invalid != NULL)
{
--
2.21.0

View File

@ -140,6 +140,10 @@
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gtksourceview.git",
"tag" : "gnome-3-24"
},
{
"type": "patch",
"path": "allow-up-to-2-invalid-segments.patch"
}
]
},