From 54e422839f926a61001af91c88cb9e8ca7067a7a Mon Sep 17 00:00:00 2001 From: Alberto Fanjul Date: Sat, 20 Apr 2019 10:47:34 +0200 Subject: [PATCH] Patch gtksourceview for files with BOM --- allow-up-to-2-invalid-segments.patch | 27 +++++++++++++++++++++++++++ org.gnome.gitgDevel.json | 4 ++++ 2 files changed, 31 insertions(+) create mode 100644 allow-up-to-2-invalid-segments.patch diff --git a/allow-up-to-2-invalid-segments.patch b/allow-up-to-2-invalid-segments.patch new file mode 100644 index 00000000..12999f87 --- /dev/null +++ b/allow-up-to-2-invalid-segments.patch @@ -0,0 +1,27 @@ +From 4ffc03c56540e5920f2701bb9342773f19d599e4 Mon Sep 17 00:00:00 2001 +From: Alberto Fanjul +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 + diff --git a/org.gnome.gitgDevel.json b/org.gnome.gitgDevel.json index 45f16c51..5e853634 100644 --- a/org.gnome.gitgDevel.json +++ b/org.gnome.gitgDevel.json @@ -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" } ] },