From 7c41bd72dac7960f40b545002ddc1b0b0aae13d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 29 Aug 2021 19:19:42 +0300 Subject: [PATCH] assets: add Debian ucf backups to ignored suffixes Refs https://manpages.debian.org/bullseye/ucf/ucf.1.en.html --- src/assets.rs | 7 +++++-- .../highlighted/Ignored suffixes/test.rs.ucf-dist | 1 + .../highlighted/Ignored suffixes/test.rs.ucf-new | 1 + .../highlighted/Ignored suffixes/test.rs.ucf-old | 1 + .../syntax-tests/source/Ignored suffixes/test.rs.ucf-dist | 1 + tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-new | 1 + tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-old | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-dist create mode 100644 tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-new create mode 100644 tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-old create mode 100644 tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-dist create mode 100644 tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-new create mode 100644 tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-old diff --git a/src/assets.rs b/src/assets.rs index 1bfe4f6d..94adf534 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -29,15 +29,18 @@ pub struct SyntaxReferenceInSet<'a> { pub syntax_set: &'a SyntaxSet, } -const IGNORED_SUFFIXES: [&str; 10] = [ +const IGNORED_SUFFIXES: [&str; 13] = [ // Editor etc backups "~", ".bak", ".old", ".orig", - // Debian and derivatives apt/dpkg backups + // Debian and derivatives apt/dpkg/ucf backups ".dpkg-dist", ".dpkg-old", + ".ucf-dist", + ".ucf-new", + ".ucf-old", // Red Hat and derivatives rpm backups ".rpmnew", ".rpmorig", diff --git a/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-dist b/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-dist new file mode 100644 index 00000000..c9281d67 --- /dev/null +++ b/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-dist @@ -0,0 +1 @@ +// foo.ucf-dist (Debian ucf backup) should highlight same as foo diff --git a/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-new b/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-new new file mode 100644 index 00000000..f5def9e3 --- /dev/null +++ b/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-new @@ -0,0 +1 @@ +// foo.ucf-new (Debian ucf backup) should highlight same as foo diff --git a/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-old b/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-old new file mode 100644 index 00000000..f4c997a7 --- /dev/null +++ b/tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-old @@ -0,0 +1 @@ +// foo.ucf-old (Debian ucf backup) should highlight same as foo diff --git a/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-dist b/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-dist new file mode 100644 index 00000000..733d0e44 --- /dev/null +++ b/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-dist @@ -0,0 +1 @@ +// foo.ucf-dist (Debian ucf backup) should highlight same as foo diff --git a/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-new b/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-new new file mode 100644 index 00000000..595c0070 --- /dev/null +++ b/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-new @@ -0,0 +1 @@ +// foo.ucf-new (Debian ucf backup) should highlight same as foo diff --git a/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-old b/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-old new file mode 100644 index 00000000..38d47380 --- /dev/null +++ b/tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-old @@ -0,0 +1 @@ +// foo.ucf-old (Debian ucf backup) should highlight same as foo