brinsche / QLSyntaxHighlight

6 stars 1 forks source link

utf8 makefile etc. #1

Open grylem opened 6 years ago

grylem commented 6 years ago

Firstly - Thank for the nice plugin. For Makefile(without extension) no highlight, for Makefile.mk etc. - all ok. Cuesheet: if .cue not utf8 encoding QLSyntaxHighlight show blank window, convert .cue to utf8 and QLSyntaxHighlight show *.cue with syntax highlight

brinsche commented 6 years ago

Thanks! I released a new version which tries to read all files as utf8 with https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy , this is obviously not a very good solution, but might be better than nothing for now, detecting the real encoding and converting is a nontrivial task but I'll try to find a solution.

I use https://docs.rs/syntect/2.0.0/syntect/parsing/struct.SyntaxSet.html#method.find_syntax_for_file for finding the syntax for a file so I'd have to hardcode support for makefiles :/

grylem commented 6 years ago

Thanks. New versions works fine for non utf8 files. About makefile: I have installed syntax for makefile and if makefile have extension like *.mk QLSyntaxHighlight works fine. If Makefile dont have extension QLSyntaxHighlight show content of Makefile without highlighting. I think it's because quicklook dont use filename and can not choose the right syntax in this case.

brinsche commented 6 years ago

I released a new version that should fix it, Makefiles should work without needing a custom syntax already

grylem commented 6 years ago

Thanks! Now all works fine. Its possible to add highlighting for binary plist?

brinsche commented 6 years ago

Do you really mean .plist files when they are saved in binary or the xml version? the xml version should work with v0.5.1 now.

grylem commented 6 years ago

Saved in binary, for xml highlight works good P.S. Its possible to add show binary file as hex?.

brinsche commented 6 years ago

Hm, I'll see what I can do but that's not as easy as the other feature requests

grylem commented 6 years ago

I previously used qlcolorcode for plist(include binary saved),xml, bash(.etc) and source code.tauQL for "public.data" and plain-text. Now QLSyntaxHighlight can replace both(tauQL and QLColorCode) for me and it's great. For complete happiness there are not enough pairs of things - highlighting binary plist, and if file binary show it like hexfiend etc. Anyway now for me QLSyntaxHighlight very very good. Thank you for making it.

brinsche commented 6 years ago

hex view for binaries is implemented now, I'll look into binary plists next

brinsche commented 6 years ago

Binary plists should work now too!

grylem commented 6 years ago

Thanks! a few comments : for binary plist work fine, about hex, if mach-o binary(public.unix-exucatable) does not have exec permissions QLSyntaxHighlight dont show as hex. If mach-o binary has exec permissions but file name contains "dot" QLSyntaxHighlight perceives like extensions and dont show hex.