-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze in large C file with treesitter #302
Comments
Because it uses the Treesitter AST, my expectation is matchup#ts_syntax#skip_expr would be very fast. (At least faster than vim syntax highlighting.) Maybe there is something wrong in the way it's computed or cached. Can you provide a sample C file which has the issue? |
|
I may have made a mistake when testing this. It seems that when I fully enable matchup treesitter support ( |
Still seems a bug. The promise of treesitter is that things are blazing
fast. I will investigate nevertheless.
…On Wed, Jul 5, 2023, 11:10 AM zeertzjq ***@***.***> wrote:
I may have made a mistake when testing this. It seems that when I fully
enable matchup treesitter support ( matchup = { enable = true },),
vim-matchup freezes Nvim every time viewport scrolls by a screen. However,
if I disable that ( matchup = { enable = false },), vim-matchup only
freezes the first time I stop cursor on a curly brace and is fast
afterwards. This is probably not needed then.
—
Reply to this email directly, view it on GitHub
<#302 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSY3DKWZBSJ2EVUX7KUWIDXOV7WDANCNFSM6AAAAAAZ6MLRCU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I see a huge amount of lag in regexp_nfa.c when scrolling but it doesn't seem to be caused by ts syntax skip but instead this call to get_active_nodes
When I comment this line out the lag disappears. What I don't understand is that get_active_nodes is gated behind ts_utils.memoize_by_buf_tick
Yet when scrolling it seems to be called again and again, even if the buffer hasn't changed. |
Had this same issue but in Lua files, when moving cursor up/down and hitting a bracked it would freeze the editor for a bit (on a very beefy machine), fixed by disabling the plugin. Might be a Neovim issue, disabled Navic as well for the same reason. |
This could be because the memoization cache is invalidated after every Lua garbage collection, which in my experience happens quite frequently... this could be improved once neovim/neovim#30227 is merged |
Is your feature request related to a problem? Please describe.
When treesitter highlighting is enabled, vim-matchup unconditionally uses treesitter delim skip, which can be very slow. In some large C files this causes vim-matchup to freeze Nvim for seconds when moving cursor onto a curly brace, and the following change makes the lag disappear:
Describe the solution you'd like
Add an option to vim-matchup to disable treesitter delim skip.
The text was updated successfully, but these errors were encountered: