]> git.eshelyaron.com Git - emacs.git/commit
Increment parser timestamp when narrowing changes (bug#67977)
authorYuan Fu <casouri@gmail.com>
Sun, 24 Dec 2023 00:47:04 +0000 (16:47 -0800)
committerYuan Fu <casouri@gmail.com>
Sun, 24 Dec 2023 02:43:51 +0000 (18:43 -0800)
commit683c7c96871cc374b0e00f5084e43a70fc3ec36a
tree1760611714cff37dae563e0b37be9925792d2a5b
parent8ae42c825e1e058d3c736837a023bdc2617b85a2
Increment parser timestamp when narrowing changes (bug#67977)

When narrowing changes, parse reparses, so the timestamp should
definitely increment, just like in ts_record_changes.

Failing to increment this timestamp, outdated nodes would think they
are still up-to-date, and try to print their type name.  Printing
their type name involves accessing the old parse tree, which is
already freed during the last reparse.

I also found that we don't increment timestamp when changing parser
ranges and fixed that as well.

* src/treesit.c (treesit_sync_visible_region):
(Ftreesit_parser_set_included_ranges): Increment timestamp.
* src/treesit.h (Lisp_TS_Parser): Add some comments.
src/treesit.c
src/treesit.h