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
Using a freshly installed version on macOS (installed via go get -u github.com/alecthomas/chroma/cmd/chroma), chroma fails to recognize the CMake language on files named CMakeListst.txt:
go get -u github.com/alecthomas/chroma/cmd/chroma
chroma
CMakeListst.txt
make_minimum_required(VERSION 3.1) project(foo)
❯ ~/go/bin/chroma --trace --json CMakeLists.txt root: pos=0, text="make_minimum_required(VERSION 3.1)\nproject(foo)\n\n" root: pos=34, text="\nproject(foo)\n\n" root: pos=35, text="project(foo)\n\n" root: pos=47, text="\n\n" root: pos=48, text="\n" [ {"type":"Text","value":"make_minimum_required(VERSION 3.1)\nproject(foo)\n\n"} ]
If the file has the .cmake extension it works fine:
❯ ~/go/bin/chroma --trace --json foo.cmake root: pos=0, text="make_minimum_required(VERSION 3.1)\nproject(foo)\n\n" args: pos=22, text="VERSION 3.1)\nproject(foo)\n\n" args: pos=29, text=" 3.1)\nproject(foo)\n\n" args: pos=30, text="3.1)\nproject(foo)\n\n" args: pos=33, text=")\nproject(foo)\n\n" root: pos=34, text="\nproject(foo)\n\n" root: pos=35, text="project(foo)\n\n" args: pos=43, text="foo)\n\n" args: pos=46, text=")\n\n" root: pos=47, text="\n\n" root: pos=48, text="\n" [ {"type":"NameBuiltin","value":"make_minimum_required"}, {"type":"Punctuation","value":"("}, {"type":"LiteralString","value":"VERSION"}, {"type":"Text","value":" "}, {"type":"LiteralString","value":"3.1"}, {"type":"Punctuation","value":")"}, {"type":"Error","value":"\n"}, {"type":"NameBuiltin","value":"project"}, {"type":"Punctuation","value":"("}, {"type":"LiteralString","value":"foo"}, {"type":"Punctuation","value":")"}, {"type":"Error","value":"\n\n"} ]
Looking at the code it seems that chroma should recognize file named CMakeListst.txt, so I'm not sure why this doesn't work here.
The text was updated successfully, but these errors were encountered:
937aba1
This was because typoscript (whatever that is) and plaintext both match *.txt and had the same priority as cmake.
Sorry, something went wrong.
Awesome, thanks for the quick fix!
Fixes alecthomas#344.
d1922ee
No branches or pull requests
jdumas commentedMar 15, 2020
•
edited
Using a freshly installed version on macOS (installed via
go get -u github.com/alecthomas/chroma/cmd/chroma
),chroma
fails to recognize the CMake language on files namedCMakeListst.txt
:If the file has the .cmake extension it works fine:
Looking at the code it seems that
chroma
should recognize file namedCMakeListst.txt
, so I'm not sure why this doesn't work here.The text was updated successfully, but these errors were encountered: