Hello, just wondering whether the patterns are interpreted similarly in the two function calls below.
-- config 1
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*/dotconfig/nvim/**/*.lua,*/.config/nvim/**/*.lua",
command = "source $MYVIMRC",
})
-- config 2
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*/dotconfig/nvim/**/*.lua", "*/.config/nvim/**/*.lua" },
command = "source $MYVIMRC",
})
The weird issue I’m having is that config 1 works fine to replace my existing vim.cmd
autocmd definition, but config 2 seems to cause nvim to use a lot of memory and take extra long to save, soon breaking Treesitter highlighting. This happens even with no LSP clients attached.
I test this with :lua for i=1, 10 do vim.cmd("w") end
Here is my full config
UPDATE:
Config 1 still causes the same problems as config 2, although not as quickly. The original vim.cmd("autocmd! BufWritePost */dotconfig/nvim/**/*.lua,*/.config/nvim/**/*.lua source $MYVIMRC")
works completely fine tho.