]> git.eshelyaron.com Git - emacs.git/commit
Fix tree-sitter fontification heuristic
authorYuan Fu <casouri@gmail.com>
Mon, 21 Nov 2022 04:29:53 +0000 (20:29 -0800)
committerYuan Fu <casouri@gmail.com>
Mon, 21 Nov 2022 09:29:31 +0000 (01:29 -0800)
commit938e68bb280c96eaf163bd932ab2582fbe27e780
tree796388ce80fd7e71cd0ecbad041c8ac346c03295
parent3069849bd4c1048a8f8c0467d26560fad939e791
Fix tree-sitter fontification heuristic

Previously applied heuristic 2 sometimes invalidates heuristic 1, add
a guard so it doesn't.

The new function is just for clearity of the code and has nothing to
do with the change itself.

* lisp/treesit.el (treesit--node-length): New function
(treesit-font-lock-fontify-region): Use the new function.  Only do
heuristic 2 when the node is large.
lisp/treesit.el