Set treesit-primary-parser for c and elixir ts mode
For buffers with multiple parsers, it's important to set this variable so font-lock invalidation works smoothly. * lisp/progmodes/c-ts-mode.el (c-ts-mode): Set treesit-primary-parser. * lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode): Set treesit-primary-parser.
This commit is contained in:
parent
2f243fb91d
commit
3cad7cc8dc
2 changed files with 4 additions and 2 deletions
|
@ -1318,7 +1318,8 @@ in your init files."
|
||||||
;; Create an "for-each" parser, see `c-ts-mode--emacs-set-ranges'
|
;; Create an "for-each" parser, see `c-ts-mode--emacs-set-ranges'
|
||||||
;; for more.
|
;; for more.
|
||||||
(when c-ts-mode-emacs-sources-support
|
(when c-ts-mode-emacs-sources-support
|
||||||
(treesit-parser-create 'c nil nil 'for-each))
|
(setq-local treesit-primary-parser
|
||||||
|
(treesit-parser-create 'c nil nil 'for-each)))
|
||||||
|
|
||||||
(treesit-parser-create 'c)
|
(treesit-parser-create 'c)
|
||||||
;; Comments.
|
;; Comments.
|
||||||
|
|
|
@ -701,7 +701,8 @@ Return nil if NODE is not a defun node or doesn't have a name."
|
||||||
(require 'heex-ts-mode)
|
(require 'heex-ts-mode)
|
||||||
(treesit-parser-create 'heex))
|
(treesit-parser-create 'heex))
|
||||||
|
|
||||||
(treesit-parser-create 'elixir)
|
(setq-local treesit-primary-parser
|
||||||
|
(treesit-parser-create 'elixir))
|
||||||
|
|
||||||
(setq-local treesit-language-at-point-function
|
(setq-local treesit-language-at-point-function
|
||||||
'elixir-ts--treesit-language-at-point)
|
'elixir-ts--treesit-language-at-point)
|
||||||
|
|
Loading…
Add table
Reference in a new issue