diff options
| author | Po Lu <luangruo@yahoo.com> | 2024-06-30 10:06:09 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2024-06-30 10:06:09 +0800 |
| commit | e2561e267fd2eb37b140a293baec79096f03290b (patch) | |
| tree | 937291ce231a708b51541bbce5f76151b344a0e0 /src | |
| parent | f0f883da4b410c606b46b61c80b874ead08335ea (diff) | |
| parent | 72cf9964f3c0fd63332884b8145399f1784de7f1 (diff) | |
Merge from savannah/emacs-30
72cf9964f3c Inaccuracy in efaq.texi
fc48e9e8ed5 ; Fix typos in DOS Makefile scripts
9b8d754579f ; * etc/NEWS: Explain Nextstep.
8819e5a45d5 Fix treesit crash (bug#71681)
eaf2dc96c1f ; Fix SHR test on MS-Windows
57880f597c5 Delete redundant mention of `with-eval-after-load'
ea8ce984342 * doc/misc/efaq.texi (New in Emacs 30): Fix typos.
45a20d781a9 ; Fix typos in symbols
d95f039af43 Document security fixes in FAQ
d063af203c8 Add "New in Emacs 30" to FAQ
ca6b484162b ; * etc/NEWS: Move "Minibuffer and Completions"
35c46663e49 ; * etc/NEWS: Move item to "Lisp Changes".
0515b38d289 ; * etc/NEWS: Move keyboard macro items closer together.
22af3a71039 ; * etc/NEWS: More copy-edits.
000ef8876ae ; * etc/NEWS: Move items to "Incompatible Lisp Changes".
4088dc8e4ce ; * etc/NEWS: Rearrange "Incompatible Lisp Changes".
179800f36bb ; * lisp/epg.el (epg--start): Add commentary about encoding.
73898f0214c Fix non-ASCII filename operatiion on EasyPG (bug#71500)
a65b6aac6b5 Silence warning with global minor mode :predicate
f5f7343ac41 ; * etc/NEWS: Move an item to "Startup Changes"
c95066bf188 ; * etc/NEWS: Move some Lisp items to better place.
bf7db88ce1f ; * etc/NEWS: Rearrange "Editing Changes in Emacs 30.1"
000424eb9eb ; * etc/NEWS: Make touch screen support more prominent.
5b5671587fb ; * etc/NEWS: Rearrange "Changes in Emacs 30.1".
31124abdefe ; * lisp/thingatpt.el (sexp-at-point): Doc fix (bug#71777).
44f269d6e60 Fix: make 'xwidget-webkit-scroll-backward' scroll backwards
358085997c6 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
736b7cad406 Add jsdoc support to php-ts-mode in <script> element
5f3d964e397 Update to Transient v0.7.2-4-gf75bc48d
# Conflicts:
# etc/NEWS
Diffstat (limited to 'src')
| -rw-r--r-- | src/treesit.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/treesit.c b/src/treesit.c index 54b16eb1bb3..f0c786e921d 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -846,7 +846,6 @@ treesit_record_change (ptrdiff_t start_byte, ptrdiff_t old_end_byte, treesit_tree_edit_1 (tree, start_offset, old_end_offset, new_end_offset); XTS_PARSER (lisp_parser)->need_reparse = true; - XTS_PARSER (lisp_parser)->timestamp++; /* VISIBLE_BEG/END records tree-sitter's range of view in the buffer. We need to adjust them when tree-sitter's @@ -948,10 +947,7 @@ treesit_sync_visible_region (Lisp_Object parser) this function is called), we need to reparse. */ if (visible_beg != BUF_BEGV_BYTE (buffer) || visible_end != BUF_ZV_BYTE (buffer)) - { - XTS_PARSER (parser)->need_reparse = true; - XTS_PARSER (parser)->timestamp++; - } + XTS_PARSER (parser)->need_reparse = true; /* Before we parse or set ranges, catch up with the narrowing situation. We change visible_beg and visible_end to match @@ -1090,6 +1086,7 @@ treesit_ensure_parsed (Lisp_Object parser) XTS_PARSER (parser)->tree = new_tree; XTS_PARSER (parser)->need_reparse = false; + XTS_PARSER (parser)->timestamp++; /* After-change functions should run at the very end, most crucially after need_reparse is set to false, this way if the function @@ -1725,7 +1722,6 @@ buffer. */) ranges); XTS_PARSER (parser)->need_reparse = true; - XTS_PARSER (parser)->timestamp++; return Qnil; } @@ -2923,11 +2919,10 @@ be completely in the region. If NODE-ONLY is non-nil, return a list of nodes. -Besides a node, NODE can also be a parser, in which case the root node -of that parser is used. -NODE can also be a language symbol, in which case the root node of a -parser for that language is used. If such a parser doesn't exist, it -is created. +Besides a node, NODE can be a parser, in which case the root node of +that parser is used. NODE can also be a language symbol, in which case +the root node of a parser for that language is used. If such a parser +doesn't exist, it is created. Signal `treesit-query-error' if QUERY is malformed or something else goes wrong. You can use `treesit-query-validate' to validate and debug @@ -2941,8 +2936,13 @@ the query. */) treesit_initialize (); - /* Resolve NODE into an actual node. */ + /* Resolve NODE into an actual node, signals if node not + up-to-date. */ Lisp_Object lisp_node = treesit_resolve_node (node); + /* As of right now, the node returned by treesit_resolve_node always + passes treesit_check_node; but it might not be true in the future, + so adding the line below just to be safe. */ + treesit_check_node (node); /* Extract C values from Lisp objects. */ TSNode treesit_node = XTS_NODE (lisp_node)->node; @@ -2970,8 +2970,8 @@ the query. */) &signal_symbol, &signal_data)) xsignal (signal_symbol, signal_data); - /* WARN: After this point, free TREESIT_QUERY and CURSOR before every - signal and return if NEEDS_TO_FREE_QUERY_AND_CURSOR is true. */ + /* WARN: After this point, if NEEDS_TO_FREE_QUERY_AND_CURSOR is true, + free TREESIT_QUERY and CURSOR before every signal and return. */ /* Set query range. */ if (!NILP (beg) && !NILP (end)) |
