Skip to content

Commit

Permalink
Make INI syntax register as handler of .inf and .INF files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Enselic committed May 10, 2022
1 parent dc7d5a8 commit 61523a1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions assets/syntaxes/02_Extra/INI.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name: INI
file_extensions:
- ini
- INI
- inf
- INF
- "inf"
- "INF"
- reg
- REG
- lng
Expand Down
5 changes: 5 additions & 0 deletions tests/syntax-tests/highlighted/INI/test.inf
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/syntax-tests/source/INI/test.inf
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 61523a1

Please sign in to comment.