Fix Ftreesit_parser_create
authorYuan Fu <casouri@gmail.com>
Mon, 22 Jul 2024 00:15:44 +0000 (17:15 -0700)
committerYuan Fu <casouri@gmail.com>
Mon, 22 Jul 2024 00:21:58 +0000 (17:21 -0700)
* src/treesit.c (Ftreesit_parser_create): Use the buffer given by the
caller rather than the current buffer.

src/treesit.c

index 416c1edf791c0cd4f5e02456565c14241b756fd0..6e806039df0b16c81ddf5b200245f9bdc14687ce 100644 (file)
@@ -1450,7 +1450,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);