summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Nordholts <enselic@gmail.com>2022-05-10 20:27:48 +0200
committerMartin Nordholts <enselic@gmail.com>2022-05-11 17:39:01 +0200
commit5fe9b3e1b3df770207f1fdda7b10893c56cd9cfb (patch)
treecfc7462add1bf38d16a670b5a5f13e365c7140f2
parentdc7d5a862f3cc5f98f4ad5b5e2e8792e01dd927e (diff)
Make `INI` syntax register as handler of `.inf` files
We need to type `inf` and `INF` as strings in `INI.sublime-syntax`, otherwise `yaml-rust` interprets them as real numbers ("infinity") and they do not get registered as file extensions: /Users/martin/src/yaml-rust # https://github.com/chyh1990/yaml-rust % cargo run --example dump_yaml ~/src/bat/assets/syntaxes/02_Extra/INI.sublime-syntax --- String("name"): String("INI") String("file_extensions"): String("ini") String("INI") Real("inf") Real("INF") ... Also add a regression test.
-rw-r--r--CHANGELOG.md1
-rw-r--r--assets/syntaxes/02_Extra/INI.sublime-syntax4
-rw-r--r--tests/syntax-tests/highlighted/INI/test.inf5
-rw-r--r--tests/syntax-tests/source/INI/test.inf5
4 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ec49e64..2456a57a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@
- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
- Slightly adjust Zig syntax. See #2136 (@Enselic)
+- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
## Themes
diff --git a/assets/syntaxes/02_Extra/INI.sublime-syntax b/assets/syntaxes/02_Extra/INI.sublime-syntax
index 4d31bffd..2ea30cd5 100644
--- a/assets/syntaxes/02_Extra/INI.sublime-syntax
+++ b/assets/syntaxes/02_Extra/INI.sublime-syntax
@@ -5,8 +5,8 @@ name: INI
file_extensions:
- ini
- INI
- - inf
- - INF
+ - "inf"
+ - "INF"
- reg
- REG
- lng
diff --git a/tests/syntax-tests/highlighted/INI/test.inf b/tests/syntax-tests/highlighted/INI/test.inf
new file mode 100644
index 00000000..dae43ba9
--- /dev/null
+++ b/tests/syntax-tests/highlighted/INI/test.inf
@@ -0,0 +1,5 @@
+[section]
+key=value
+# This file is just for testing that the INI syntax is registered to handle
+# the .inf file extension, it is not testing the syntax highlighting capabilities
+# of the INI syntax itself
diff --git a/tests/syntax-tests/source/INI/test.inf b/tests/syntax-tests/source/INI/test.inf
new file mode 100644
index 00000000..5b03db1c
--- /dev/null
+++ b/tests/syntax-tests/source/INI/test.inf
@@ -0,0 +1,5 @@
+[section]
+key=value
+# This file is just for testing that the INI syntax is registered to handle
+# the .inf file extension, it is not testing the syntax highlighting capabilities
+# of the INI syntax itself