-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: highlight faces #2
base: main
Are you sure you want to change the base?
Conversation
- To make `-` before attrs highlighted
- `$` in atom and string - Tripled-quoted string in doc or Var
8cc0a94
to
a37f7d2
Compare
@@ -306,7 +422,8 @@ Use `treesit-font-lock-level' or `treesit-font-lock-feature-list' | |||
(advice-add #'erlang-font-lock-level-3 :around #'erlang-ts--font-lock-level-3) | |||
(advice-add #'erlang-font-lock-level-4 :around #'erlang-ts--font-lock-level-4) | |||
|
|||
(treesit-major-mode-setup)) | |||
(treesit-major-mode-setup) | |||
(setq-local syntax-propertize-function #'erlang-ts--syntax-propertize)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's prudent to use syntax-propertize-function
in a TreeSitter-powered mode, as you'll font-locking stuff at two different levels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used to modify char syntax in captured string.
since:
...
:syntax-table erlang-mode-syntax-table
...
erlang-mode marked char $
as "/"
, aka character-quote
.
see also https://github.com/erlang/otp/blob/master/lib/tools/emacs/erlang.el#L1569
set syntax-propertize-function only for put-text-property to avoid '
, "
, $
are incorrectly highlighted in string or binary, and now there are triple-quoted string.
(Also, some emacs packages use char-syntax to jump between words.
The erlang char $a
causes these packages to try to find another $
character to match the bracket)
A new commit copied erlang-mode-syntax-table
and unset $
.
9f8ace0
to
e6c3a85
Compare
- for char like `$'`, `$"`, `$\"`, modify text property as word
few highlight faces:
