summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLostNeophyte <[email protected]>2023-04-15 19:48:06 +0200
committerGitHub <[email protected]>2023-04-15 13:48:06 -0400
commit70ce6b7ddc73f2f28938c7a6e128e6afc84a2b70 (patch)
tree1dc415b9e169aeafb0109d2e5845a0c99ae70888
parent3b16c266d7ecfbe3778d97b917fa5bfa8ab2f578 (diff)
fix: make FileOpened autocmd work with quickfix (#4040)
-rw-r--r--lua/lvim/core/autocmds.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/lua/lvim/core/autocmds.lua b/lua/lvim/core/autocmds.lua
index a951ef56..1f190f27 100644
--- a/lua/lvim/core/autocmds.lua
+++ b/lua/lvim/core/autocmds.lua
@@ -123,13 +123,13 @@ function M.load_defaults()
"BufEnter",
{
group = "_dir_opened",
- once = true,
+ nested = true,
callback = function(args)
local bufname = vim.api.nvim_buf_get_name(args.buf)
if require("lvim.utils").is_directory(bufname) then
vim.api.nvim_del_augroup_by_name "_dir_opened"
vim.cmd "do User DirOpened"
- vim.api.nvim_exec_autocmds("BufEnter", {})
+ vim.api.nvim_exec_autocmds(args.event, { buffer = args.buf, data = args.data })
end
end,
},
@@ -138,10 +138,11 @@ function M.load_defaults()
{ "BufRead", "BufWinEnter", "BufNewFile" },
{
group = "_file_opened",
- once = true,
+ nested = true,
callback = function(args)
local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf })
if not (vim.fn.expand "%" == "" or buftype == "nofile") then
+ vim.api.nvim_del_augroup_by_name "_file_opened"
vim.cmd "do User FileOpened"
require("lvim.lsp").setup()
end