>> 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4