sbarex / SourceCodeSyntaxHighlight

Quick Look extension for highlight source code files on macOS 10.15 and later.
GNU General Public License v3.0
3.02k stars 72 forks source link

How to remove/add support to specific file type in Syntax Highlight? #162

Open water137780117 opened 2 years ago

water137780117 commented 2 years ago

In my mac, when Syntax Highlight Extension was disabled, public.unix-executable files were taken over by Apparency.app.

Screen Shot 2022-04-07 at 00 35 31 (2)

When Syntax Highlight Extension was enabled, although binary files were set to "ignore", Apparency information couldn't be shown anymore.

Screen Shot 2022-04-06 at 23 28 54 (2)

When binary files were set to "dump", they were quicklooked as hex files.

Screen Shot 2022-04-07 at 00 31 10 (2)

In general, is there a way to let Syntax Highlight ignore public.unix-executable files completely? And maybe other file type as well. I tried to delete "public.unix-executable" in "Info.plist" of "Syntax Highlight Quicklook Extension.appex" but it didn't work.

Also, is there a way to add support to specific plain text files with extensions? Maybe just like adding UTI names "dyn.XXXXXXXX" to "Info.plist" inside "QLColorCode.qlgenerator". I tried to add "dyn.XXXXXXXX" to "Info.plist" of "Syntax Highlight Quicklook Extension.appex" but it didn't work.

Thank you very much!

sbarex commented 2 years ago

As written in the FAQ it is not possible to enable / disable support for single formats and not even dynamically associate new formats (for files with an extension).

Disabling binary file support simply does not generate the preview but the files are still handled. There is no way to set at runtime which formats to manage and which ones to be managed by other generators.

Editing the Info.plist file also causes corruption of the application signature and consequently stops working.

In System Preferences / Extensions / Quicklook, drag Apparency to the top to give it higher priority and maybe it will be used instead of SyntaxHighlight.

water137780117 commented 2 years ago

Thanks for your reply. I have drag Apparency to the top, but public.unix-executable files are still handled by SyntaxHighlight.

sbarex commented 2 years ago

have you tried to restart? otherwise I have no ideas :man_shrugging:

water137780117 commented 2 years ago

have you tried to restart? otherwise I have no ideas 🤷‍♂️

Unfortunately, it still doesn't work... I'm confused of the priority rule. Why does SyntaxHightlight always have higher priority than Apparency? 😂

sbarex commented 2 years ago

I'm afraid only Apple knows ...