3 ms·
I wrote similar code in emacs for harmonia-mode in the past. Let me find and share the source code. We don't need font-lock. We can just borrow the styles it us
by toomim 2y ago
I wrote similar code in emacs for harmonia-mode in the past. Let me find and share the source code. We don't need font-lock. We can just borrow the styles it uses.
*Update:* I found the code. Instead of using font-lock, we simply draw our own overlays over the text and color them, which is what font-lock does. Font-lock IIRC is specifically designed to use regexps to parse the text. We don't need that. So throw font-lock away. Tree-Sitter itself knows how the parse tree maps to text regions. Just use that information to draw the overlays directly. It's way simpler that way.
Lemme know if anyone wants the code.
- vzaliva 2y agoIt's starting to sound like it's time to create a GitHub repository and start putting it all together. My elisp skills are basic, so I could help more with testing, coordination, publishing packages, or documentation. Shall I create the repo?
- vzaliva 2y agorepo created. I've sent you a request on github.