fix: callbacks

Manually picked from https://github.com/Pocco81/auto-save.nvim/pull/67/,
namely 6203ae6d23625b93e563b8893cefb99e55ecb06f.
This commit is contained in:
Oula Kuuva
2023-02-12 18:30:51 +02:00
parent 376dd62508
commit 9d1c250bd2

View File

@@ -1,7 +1,5 @@
local M = {}
local cnf = require("auto-save.config").opts
function M.set_of(list)
local set = {}
for i = 1, #list do
@@ -17,6 +15,8 @@ function M.not_in(var, arr)
end
function M.do_callback(callback_name)
local cnf = require("auto-save.config").opts
if type(cnf.callbacks[callback_name]) == "function" then
cnf.callbacks[callback_name]()
end