Fix debounce_delay option not being read

When this file is loaded, `cnf` has default options
This commit is contained in:
nmet
2022-08-22 19:54:18 -03:00
committed by okuuva
parent fc7c13d755
commit 492bab0c47

View File

@@ -112,10 +112,13 @@ function M.save(buf)
end
end
local save_func = (cnf.opts.debounce_delay > 0 and debounce(M.save, cnf.opts.debounce_delay) or M.save)
local save_func = nil
local function perform_save()
g.auto_save_abort = false
if save_func == nil then
save_func = (cnf.opts.debounce_delay > 0 and debounce(M.save, cnf.opts.debounce_delay) or M.save)
end
save_func()
end