Repair --default-language, and highlight using full filename
Repair --default-language, and highlight using full filename
Fixed that the "txt" fallback was used instead of --default-language
And when looking for syntax highlighting, keep the filename around as long as possible.
Using simple custom logic (filename > 4) a Makefile can be highlight with make syntax, but a cc or ini file does not get treated like a .cc or .ini file.
Currently the underlying highlighting lib syntect and the sublime syntex definitions can not make this distinction (http://www.sublimetext.com/docs/syntax.html).
Plus clippy warnings
The filename cutoff is 4, not 3 (from actual DOS 8.3 filenames) because of newer extensions like .toml and .flac. And I could not think of file formats without extensions which are just 4 short and have a meaning by itself, like Makefile. Maybe this could even be extended to 5.
This should fix #1513
@th1000s I just saw you submitted a PR for an issue I reported. Thank you! do you by any chance to incorporate the feedback comments from @dandavison ? I'd love to see your fix applied. Thanks!
Thanks @th1000s!
(The MacOS build failure occurs on main; I am not sure why yet)