Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make INI syntax register as handler of .inf files #2190

Merged
merged 1 commit into from
May 11, 2022

Conversation

Enselic
Copy link
Collaborator

@Enselic Enselic commented May 10, 2022

I discovered this while debugging an unexpected diff of assets/syntaxes.bin for the upcoming v0.21.0 release.

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")        <--- NOTE: Interpreted as real number
        Real("INF")
...

Also add a regression test.

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.
@Enselic Enselic changed the title Make INI syntax register as handler of .inf and .INF files Make INI syntax register as handler of .inf files May 10, 2022
@Enselic Enselic merged commit 5fe9b3e into sharkdp:master May 11, 2022
@Enselic Enselic deleted the ini-handles-inf branch May 11, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants