mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-09 17:04:36 +02:00
fix(ui): work-around for telescope issue with treesitter folds
This commit is contained in:
parent
0e16033e9c
commit
ccff8683ba
1 changed files with 13 additions and 0 deletions
|
@ -91,3 +91,16 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
|||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
-- HACK: re-caclulate folds when entering a buffer through Telescope
|
||||
-- @see https://github.com/nvim-telescope/telescope.nvim/issues/699
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = augroup("fix_folds"),
|
||||
callback = function()
|
||||
if vim.opt.foldmethod:get() == "expr" then
|
||||
vim.schedule(function()
|
||||
vim.opt.foldmethod = "expr"
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue