Verified that the treesitter reload autocmd is required to rebuild the tree after major tree changes or else the folds won't work. Future work will be needed to verify if this can be replaced, is a known bug, etc.
This commit is contained in:
parent
2e526c7e44
commit
cbbb18df63
13
init.lua
13
init.lua
@ -282,13 +282,12 @@ vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
|
|||||||
command = "source % | PackerCompile"
|
command = "source % | PackerCompile"
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Fix for treesitter folds
|
-- Fix for treesitter folds, as folds are not recalculated upon buffer changes (especially when pasting text)
|
||||||
-- TODO: Determine if this is required
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufNew', 'BufWinEnter' }, {
|
||||||
-- vim.api.nvim_create_autocmd({ 'BufEnter', 'BufNew', 'BufWinEnter' }, {
|
pattern = '*',
|
||||||
-- pattern = '*',
|
group = vim.api.nvim_create_augroup('telescope_fold_workaround', { clear = true }),
|
||||||
-- group = vim.api.nvim_create_augroup('telescope_fold_workaround', { clear = true }),
|
command = 'set foldexpr=nvim_treesitter#foldexpr()',
|
||||||
-- command = 'set foldexpr=nvim_treesitter#foldexpr()',
|
})
|
||||||
-- })
|
|
||||||
|
|
||||||
-- Create a new copy of capabilities and enable the snippetSupport
|
-- Create a new copy of capabilities and enable the snippetSupport
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user