From: Eli Zaretskii Date: Thu, 24 Nov 2022 09:09:51 +0000 (+0200) Subject: Avoid assertion violations in treesit.c when editing non-ASCII X-Git-Tag: emacs-29.0.90~1545 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=825221183390f61f163258e09e91c0a75bf6d645;p=emacs.git Avoid assertion violations in treesit.c when editing non-ASCII * src/treesit.c (make_treesit_parser): Use byte positions when initializing 'lisp_parser'. This avoids assertion violations when the buffer has non-ASCII characters. --- diff --git a/src/treesit.c b/src/treesit.c index 7834eb1a682..3df53f2179d 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -983,8 +983,8 @@ make_treesit_parser (Lisp_Object buffer, TSParser *parser, TSInput input = {lisp_parser, treesit_read_buffer, TSInputEncodingUTF8}; lisp_parser->input = input; lisp_parser->need_reparse = true; - lisp_parser->visible_beg = BUF_BEGV (XBUFFER (buffer)); - lisp_parser->visible_end = BUF_ZV (XBUFFER (buffer)); + lisp_parser->visible_beg = BUF_BEGV_BYTE (XBUFFER (buffer)); + lisp_parser->visible_end = BUF_ZV_BYTE (XBUFFER (buffer)); lisp_parser->timestamp = 0; lisp_parser->deleted = false; lisp_parser->has_range = false;