diff options
author | Yuan Fu <casouri@gmail.com> | 2023-12-16 17:15:04 -0800 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2023-12-23 15:03:26 -0800 |
commit | 6ea507296a7e8bd55df8961793b02cf54d0f3c72 (patch) | |
tree | 68b8300f58d4e1002d67a1272ee85a70a0ce6544 /test/lisp/emacs-lisp | |
parent | a4751657389cf47c18416fa5d148ad2a67e14565 (diff) | |
download | emacs-6ea507296a7e8bd55df8961793b02cf54d0f3c72.tar.gz emacs-6ea507296a7e8bd55df8961793b02cf54d0f3c72.tar.bz2 emacs-6ea507296a7e8bd55df8961793b02cf54d0f3c72.zip |
Correctly refontify changed region in tree-sitter modes (bug#66732)
We already have treesit--font-lock-notifier that should mark changed
regions to be refontified, but it's called too late in the redsiplay &
fontification pipeline. Here we add treesit--pre-redisplay that
forces reparse and calls notifier functions in
pre-redisplay-functions, which is early enough for the marking to take
effect.
Similarly, we force reparse in
syntax-propertize-extend-region-functions so syntax-ppss will have the
up-to-date syntax information when it scans the buffer text. We also
record the lowest start position of the affected regions, and make
sure next syntex-propertize starts from that position.
* lisp/treesit.el (treesit--pre-redisplay-tick):
(treesit--syntax-propertize-start): New variable.
(treesit--syntax-propertize-notifier):
(treesit--pre-redisplay):
(treesit--pre-syntax-ppss): New functions.
(treesit-major-mode-setup): Add hooks.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Remove notifier.
(ruby-ts--parser-after-change): Remove notifier function.
Diffstat (limited to 'test/lisp/emacs-lisp')
0 files changed, 0 insertions, 0 deletions