fix: disabling autosave wouldn't work (#28)

This commit is contained in:
Toni Müller
2023-07-04 07:13:07 +02:00
committed by GitHub
parent d97f914e94
commit a9d9bce391
2 changed files with 4 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ local function defer_save(buf)
end
function M.on()
local augroup = autocmds.create_augroup()
local augroup = autocmds.create_augroup({ clear = true })
api.nvim_create_autocmd(cnf.opts.trigger_events.immediate_save, {
callback = function(opts)

View File

@@ -4,9 +4,10 @@ local api = vim.api
local augroup_name = "AutoSave"
--- @param opts? table
--- @return number
M.create_augroup = function(opts)
opts = opts or {}
api.nvim_create_augroup(augroup_name, opts)
opts = opts or { clear = true }
return api.nvim_create_augroup(augroup_name, opts)
end
--- @param pattern string