]> git.eshelyaron.com Git - emacs.git/commit
Make tree-sitter fontification automatically update
authorYuan Fu <casouri@gmail.com>
Tue, 15 Nov 2022 10:30:50 +0000 (02:30 -0800)
committerYuan Fu <casouri@gmail.com>
Tue, 15 Nov 2022 10:30:50 +0000 (02:30 -0800)
commit63f8a838eccf201d6290d0dc8f83881f41785afb
tree00800d9dc117223574fabe640af9dcbe22fda933
parente0760599b045a7ef3828ae4b624246b6beec2e75
Make tree-sitter fontification automatically update

Now nodes that are affected and changed during re-parse will be
correctly refontified.  Nodes can change even if it corresponding text
wasn't edited: additional text can complete the parse tree and resolve
error nodes, for example.

* lisp/progmodes/python.el (python-mode): Create Python parser before
calling treesit-major-mode-setup.
* lisp/treesit.el (treesit--font-lock-notifier): New function.
(treesit-major-mode-setup): Register fontifier with every existing
parser.
lisp/progmodes/python.el
lisp/treesit.el