Skip to content

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.

@Enselic Enselic force-pushed the ini-handles-inf branch from cd836e4 to 61523a1 Compare May 10, 2022 18:42
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 force-pushed the ini-handles-inf branch from 61523a1 to 637578f Compare May 10, 2022 18:43
@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.

2 participants