RamonUnch / AltSnap

Maintained continuation of Stefan Sundin's AltDrag
GNU General Public License v3.0
2.26k stars 75 forks source link

dni: Add syntax highlighting #571

Closed brian6932 closed 1 week ago

brian6932 commented 2 weeks ago

The GitHub frontend parses this file, and will apply ini syntax highlighting to the dni file. https://github.com/brian6932/AltSnap/blob/patch-1/AltSnap.dni vs https://github.com/RamonUnch/AltSnap/blob/main/AltSnap.dni. When swapping back and forth, make sure to CTRL+SHIFT+R or CTRL+F5 at least once, or use separate browsers, to invalidate the GH frontend's cache. Realistically a name like AltSnap-default.ini would be better than AltSnap.dni, as it would work OOTB on most editors, and the GH frontend. I also noticed that this file's no longer utf16le, and is now utf8, was this intended? If not it can be changed in this file here with working-tree-encoding.

RamonUnch commented 2 weeks ago

Thanks for the detail. encoding is a mistake though, it should be utf16le with the BOM. I think github really hates anything other than utf-8. I prefer the .dni extension because as funny as it sounds I want to keep those names 8.3 compatible. I still have troubles with FAT32 stuff sometime.

brian6932 commented 2 weeks ago

encoding is a mistake though, it should be utf16le with the BOM.

I'll add that in.

I think github really hates anything other than utf-8.

git does, and GitHub by proxy.

brian6932 commented 2 weeks ago

~~It seems like utf-16-le-bom isn't documented, but people do use it. There are some issues with git actually converting the file (git add --renormalize AltSnap.dni). error: failed to encode 'AltSnap.dni' from utf-16-le-bom to UTF-8 But maybe this at least works in the frontend? I'm not too sure, realistically I'd want to clone/checkout the branch, and see if it works as expected. Relevant Linux kernel mailing list logs regarding this https://lore.kernel.org/git/CA+JQ7M_Q_Qkh=+qziKg379e_xywQn2RBeAPNx29Dw6a5RXkY1A@mail.gmail.com/T/. Supporting legacy encodings' quite the pain 😅. It seems to clone right at the very least, but I don't believe it's being tracked as expected due to that error.~~ Contrary to my editor's recommendation, the actual formatting for this was wrong :D, and undocumented. This works as intended now. https://github.com/brian6932/AltSnap/commit/32522203288919ba4ff3ae129eab9f799c96eed2 🎉 the frontend understands it!