You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In emacs-tree-sitter, keywords like if/else/for/while/return (in C/C++/Java etc.) are all treated as tree-sitter-hl-face:keyword. However, in Neovim's tree-sitter support for instance, return is rendered differently to if/else/for/while. Implementation-wise, how hard would it be for emacs-tree-sitter to also differentiate these keywords with a more fine-grained control? As an Emacs-theme maker myself, this also gives me more faces to fine-tune my themes.
A couple of screenshots to illustrate my point. Please ignore the color differences, as those are minor implementation details. The main issue is the ability to differentiate different keywords
In Emacs:
In Neovim:
The text was updated successfully, but these errors were encountered:
So looking through the C++ tree-sitter grammar, it certainly recognizes if statements directly, and it seems like specifying faces for certain elements would done as it is shown here. I used to specify custom faces for some Python keywords by modifying this file, but I'm not sure that is the best way to achieve custom themes.
Then you need either a) a face tree-sitter-hl-face:keyword.control or b) a face with a different name and a mapping function to return it, advising emacs-tree-sitter, as shown in the wiki:
In emacs-tree-sitter, keywords like
if/else/for/while/return
(in C/C++/Java etc.) are all treated astree-sitter-hl-face:keyword
. However, in Neovim's tree-sitter support for instance,return
is rendered differently toif/else/for/while
. Implementation-wise, how hard would it be for emacs-tree-sitter to also differentiate these keywords with a more fine-grained control? As an Emacs-theme maker myself, this also gives me more faces to fine-tune my themes.A couple of screenshots to illustrate my point. Please ignore the color differences, as those are minor implementation details. The main issue is the ability to differentiate different keywords
In Emacs:
In Neovim:
The text was updated successfully, but these errors were encountered: