added doc and fixed small logic issues with debounce_delay

This commit is contained in:
Pocco81
2021-07-15 11:19:52 -05:00
parent 6d59c6141f
commit ad0c8c8f6f
4 changed files with 18 additions and 11 deletions
+4 -2
View File
@@ -6,6 +6,8 @@ local opts = require("autosave.config").options
local autosave = require("autosave")
local default_event = "InsertLeave"
local modified
local M = {}
local function table_has_value(tbl, value)
@@ -27,7 +29,7 @@ local function get_modified()
end
local function actual_save()
-- might use update, but in that case it can't be checekd if a file was modified and so it will always
-- might use update, but in that case it can't be checked if a file was modified and so it will always
-- print opts["execution_message"]
if (api.nvim_eval([[&modified]]) == 1) then
cmd("silent! write")
@@ -148,7 +150,7 @@ local function parse_events()
end
function M.load_autocommands()
if opts["debounce_delay"] == false then
if opts["debounce_delay"] == 0 then
M.debounced_save = actual_save
else
M.debounced_save = debounce(actual_save, opts["debounce_delay"])