Better events default

This commit is contained in:
Tim Macfarlane
2021-07-17 10:04:15 +02:00
parent de73572d4e
commit 86adb4ef60
4 changed files with 9 additions and 15 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ local config = {}
config.options = {
enabled = true,
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
events = {"InsertLeave"},
events = {"InsertLeave", "TextChanged"},
conditions = {
exists = true,
filetype_is_not = {},
+2 -8
View File
@@ -113,17 +113,11 @@ function M.save()
end
local function parse_events()
local events = ""
if (next(opts["events"]) == nil or opts["events"] == nil) then
events = default_event
return default_event
else
for event, _ in pairs(opts["events"]) do
events = events .. opts["events"][event] .. ","
end
return table.concat(opts["events"], ",")
end
return events
end
function M.load_autocommands()