From 2bf6b6e3b45155c846675d6d1d0f7e248f6c9eb2 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Tue, 5 Sep 2023 21:41:08 +0700 Subject: [PATCH] chore(config): workaround to update fold Thanks: - https://github.com/nvim-treesitter/nvim-treesitter/issues/1337 - https://www.jmaguire.tech/posts/treesitter_folding/ --- data/nvim/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/nvim/init.lua b/data/nvim/init.lua index 714debe..0f01595 100644 --- a/data/nvim/init.lua +++ b/data/nvim/init.lua @@ -408,6 +408,16 @@ require("lazy").setup({ "yaml", }, }) + + -- Workaround to update fold + -- https://github.com/nvim-treesitter/nvim-treesitter/issues/1337 + -- https://www.jmaguire.tech/posts/treesitter_folding/ + local augroup = vim.api.nvim_create_augroup("UserTreesitterConfig", {}) + vim.api.nvim_create_autocmd("BufEnter", { + group = augroup, + pattern = "*", + command = "normal zR", + }) end, },