aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorYuan Fu2024-08-25 17:59:51 -0700
committerYuan Fu2024-08-25 18:15:06 -0700
commitb8c05d73a1105851bbe9871d6a64efc06ddc5b6e (patch)
tree4d5a28a8c59d1113b23a5dd691e10c6cbbb686b7 /java
parentaa6ed7f67ec7ed08224e6ab2aab0a5b65f2bc314 (diff)
downloademacs-b8c05d73a1105851bbe9871d6a64efc06ddc5b6e.tar.gz
emacs-b8c05d73a1105851bbe9871d6a64efc06ddc5b6e.zip
Fix tree-sitter local parser overlay cleanup routine
Sorry for sneaking in a sizable commit so late. But I just found out about this bug and it has to be fixed. Before this change, we weren't properly cleaning up overlays that store local parsers. And in the case of doxygen local parser in C files, the doxygen local parser overlay sometimes bleeds out of comments and into other code, and interferes with font-lock and indentation. This commit adds a cleanup function that'll cleanup any overlays that aren't being used. I tested with doxygen in C files and everything works smoothly now, including tricky tests like removing the ending "*/" of a doxygen comment and adding it back. The idea is simple, at the end of each call to (treesit-update-ranges BEG END), we remove any overlay within BEG and END that wasn't touched by the range setting code. * lisp/treesit.el (treesit--cleanup-local-range-overlays): New function. (treesit--update-ranges-local): Remove code for cleaning up zero-length overlays since we have the cleanup function now. (treesit-update-ranges): Wrap the function body inside a let form, which defines modified-tick; and add a call to treesit--cleanup-local-range-overlays at the very end.
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions