From b252608cdc1e52e76a0a58bc596d4daa08db2b81 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sun, 21 Jul 2024 17:15:44 -0700 Subject: [PATCH] Fix Ftreesit_parser_create * src/treesit.c (Ftreesit_parser_create): Use the buffer given by the caller rather than the current buffer. (cherry picked from commit 87f41b937bc06a14b3aeb12d5bf1a8b3e2ff74a1) --- src/treesit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/treesit.c b/src/treesit.c index baa1b8dfd11..45db71bb5fd 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1457,7 +1457,9 @@ an indirect buffer. */) ts_parser_set_language (parser, lang); /* Create parser. */ - Lisp_Object lisp_parser = make_treesit_parser (Fcurrent_buffer (), + Lisp_Object lisp_buf; + XSETBUFFER (lisp_buf, buf); + Lisp_Object lisp_parser = make_treesit_parser (lisp_buf, parser, NULL, language, tag); -- 2.39.2