[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard agai
From: |
Stefan Monnier |
Subject: |
Re: master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers. |
Date: |
Wed, 23 Nov 2022 09:57:38 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>> But my question was not so much pointing out a problem but trying to
>> understand why we chose the more complex code.
> Because we need to compare with byte positions,
Ah, because we wrote "(in bytes)" in the docstring of
`treesit-max-buffer-size`. That's a rather unusual choice. All other
places were we use(d) a limit on the buffer size it's always been based
on the number of chars.
I doubt it would make a significant difference here either (e.g. not
only the "10 times" memory use of the tree-sitter tree is obviously
a rough approximation, but I doubt it's related to the number of bytes
more than to the number of chars or even the number of lexemes).
Stefan