Open jugarpeupv opened 2 months ago
I found this issue that seems to be related to the foldexpr. After commenting out the following configuration, the performance returned to normal:
vim.wo.foldmethod = 'expr'
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
Related issues:
Can confirm this indeed fixed my issues with toggleterm
@akinsho - if you would have any interest in me adding a fix for this issue, I would be more than happy to open a PR to add an autocmd here to disable foldexpr for terminal to fix this issue. If not, no worries 👍
I've added this to my config, and would refactor slightly for PR if change wanted.
vim.api.nvim_create_augroup("disable_folding_toggleterm", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
group = "disable_folding_toggleterm",
pattern = "toggleterm",
callback = function(ev)
local bufnr = ev.buf
vim.api.nvim_buf_set_option(bufnr, "foldmethod", "manual")
vim.api.nvim_buf_set_option(bufnr, "foldtext", "foldtext()")
end,
})
Is there an existing issue for this?
Current Behavior
If i run tree / in a normal :term buffer i can open it instantly, however if i do it with toggleterm then it takes a lot of time to open the terminal
Expected Behavior
It takes the same time than :term command
Steps To Reproduce
Install plugin, run tree / wait for the screen to load a lot of text, then toggleterm and the time it takes to open is very large
Environment
Anything else?
No response