summaryrefslogtreecommitdiff
path: root/pluma
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-09-19 22:09:57 +0200
committerraveit65 <[email protected]>2020-10-03 20:33:19 +0200
commit5e6681e5114af06972226ba1b9bff7b239c46f6d (patch)
treecc495d9346b14751d60c6d7b7d563ea18505fb1b /pluma
parentbba42125fb0d1dd10246e20e0b1156b5c40620f7 (diff)
downloadpluma-5e6681e5114af06972226ba1b9bff7b239c46f6d.tar.bz2
pluma-5e6681e5114af06972226ba1b9bff7b239c46f6d.tar.xz
pluma-document: highlighting for BOM was fixed on gtksourceview 3.24.11
See https://gitlab.gnome.org/GNOME/gtksourceview/-/commit/54e48e9c
Diffstat (limited to 'pluma')
-rw-r--r--pluma/pluma-document.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pluma/pluma-document.c b/pluma/pluma-document.c
index a7691f45..53345e38 100644
--- a/pluma/pluma-document.c
+++ b/pluma/pluma-document.c
@@ -650,6 +650,7 @@ pluma_document_class_init (PlumaDocumentClass *klass)
GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE);
}
+#if !GTK_SOURCE_CHECK_VERSION (3, 24, 11)
static gboolean
file_with_bom (GFile *file)
{
@@ -692,6 +693,7 @@ file_with_bom (GFile *file)
else
return FALSE;
}
+#endif
static void
set_language (PlumaDocument *doc,
@@ -699,12 +701,15 @@ set_language (PlumaDocument *doc,
gboolean set_by_user)
{
GtkSourceLanguage *old_lang;
+
+#if !GTK_SOURCE_CHECK_VERSION (3, 24, 11)
const gchar *new_lang_id;
const gchar *bom_langs[] = {
"asp", "dtl", "docbook", "html", "mxml", "mallard", "markdown",
"mediawiki", "php", "tera", "xml", "xslt", NULL
};
gboolean is_bom_lang = FALSE;
+#endif
pluma_debug (DEBUG_DOCUMENT);
@@ -713,6 +718,7 @@ set_language (PlumaDocument *doc,
if (old_lang == lang)
return;
+#if !GTK_SOURCE_CHECK_VERSION (3, 24, 11)
new_lang_id = gtk_source_language_get_id (lang);
if (new_lang_id)
is_bom_lang = g_strv_contains (bom_langs, new_lang_id);
@@ -733,6 +739,7 @@ set_language (PlumaDocument *doc,
gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (doc), lang);
}
else
+#endif
gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (doc), lang);
if (lang != NULL)