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
Terminal buffers receiving streaming data foldexpr set to treesitter lock up the main thread, rendering nvim virtually inoperable.
Minimal repro
pcall(vim.treesitter.start)
vim.cmd.split()
vim.cmd.term()
vim.wo.foldmethod="expr" -- use treesitter foldsvim.wo.foldexpr="v:lua.vim.treesitter.foldexpr()"vim.bo.filetype="baseterm"
Then run the following in the terminal
while true; do echo test; done
Now if you exit terminal mode and try to navigate to the first split with the [No name] buffer and start typing, go in normal mode and try to move the cursor back/forward ([b] and [w]). There is a significant lag in every motion.
Expected behavior
Terminal data streaming should not lock up nvim.
The text was updated successfully, but these errors were encountered:
Small correction, seems like foldmethod is affecting this greatly, discovered that the global config that i had enabled - vim.o.foldmethod="expr" along with vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" , was getting applied to the terminal buffer, and that is what seems to be destroying the perofrmance, even though the treesitter is not active in that buffer.
asmodeus812
changed the title
Speeding up terminal buffer rendering during streaming with bigger scrollback values
Setting foldmethod and foldexpr to treesitter affect terminal buffer
May 10, 2024
Problem
Terminal buffers receiving streaming data foldexpr set to treesitter lock up the main thread, rendering nvim virtually inoperable.
Minimal repro
Then run the following in the terminal
Now if you exit terminal mode and try to navigate to the first split with the [No name] buffer and start typing, go in normal mode and try to move the cursor back/forward ([b] and [w]). There is a significant lag in every motion.
Expected behavior
Terminal data streaming should not lock up nvim.
The text was updated successfully, but these errors were encountered: