You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In a lua file, ts's indent method takes 0.02s which is a noticeable delay when I type o. After trying zed, which also use treessitter to indent, I found their speed is super fast(new line).
With some curiosity to scan their code, I found zed computes an indent map that is (line->indent) for the whole buffer and that's where the speed comes from. I think nvim-treessitter can adapt that pattern too.
For simplicity I want to cache get_indent() call's result at CursorMove and apply result when I type o so eliminating latency, but it turns out that when I type o, neovim adds a new line below and change cursor position at first(not showed in ui) and then calls indentexpr, for that reason, calling get_indent() mannally don't works, do you have any suggestions to get real indent?
Is your feature request related to a problem? Please describe.
In a lua file, ts's indent method takes 0.02s which is a noticeable delay when I type o. After trying zed, which also use treessitter to indent, I found their speed is super fast(new line).
With some curiosity to scan their code, I found zed computes an indent map that is (line->indent) for the whole buffer and that's where the speed comes from. I think nvim-treessitter can adapt that pattern too.
relevant code
The text was updated successfully, but these errors were encountered: