mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2026-05-29 17:32:11 +00:00
Better events default
This commit is contained in:
@@ -122,7 +122,7 @@ As it's stated in the TL;DR, there are already some sane defaults that you may l
|
||||
```lua
|
||||
enabled = true,
|
||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave"},
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
@@ -146,7 +146,7 @@ autosave.setup(
|
||||
{
|
||||
enabled = true,
|
||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave"},
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
@@ -174,7 +174,7 @@ autosave.setup(
|
||||
{
|
||||
enabled = true,
|
||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave"},
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ As it's stated in the TL;DR, there are already some sane defaults that you may l
|
||||
```lua
|
||||
enabled = true,
|
||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave"},
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
@@ -85,7 +85,7 @@ autosave.setup(
|
||||
{
|
||||
enabled = true,
|
||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave"},
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
@@ -108,7 +108,7 @@ autosave.setup(
|
||||
{
|
||||
enabled = true,
|
||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave"},
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
|
||||
@@ -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 = {},
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user