okuuva / auto-save.nvim

🧶 Automatically save your changes in NeoVim
GNU General Public License v3.0
154 stars 8 forks source link

auto-save not working on "TextChanged" #43

Closed parik-shit closed 9 months ago

parik-shit commented 9 months ago
{
"okuuva/auto-save.nvim",
cmd = "ASToggle", -- optional for lazy loading on command
event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events
opts = {

},
},

auto-save is only working when I leave Insert Mode

parik-shit commented 9 months ago

Okay, so I added FocusLost event but it is still not working. I guess immediate save has already been implemented but seems to be having on my neovim config.

okuuva commented 9 months ago

auto-save is only working when I leave Insert Mode

Could you give a bit more details on how exactly it isn't working? So it's not auto-saving at all or it's not auto-saving immediately?

Okay, so I added FocusLost event but it is still not working. I guess immediate save has already been implemented but seems to be having on my neovim config.

By default InsertLeave and TextChanged only trigger deferred save which saves the buffer automatically after debounce delay unless it gets cancelled by an event listed in the trigger_events.cancel_deferred_save table (by default only InsertEnter). If you want InsertLeave to trigger an automatic save you need to add it to trigger_events.immediate_save table and remove it from the trigger_events.defer_save table so that it doesn't trigger two saves. Check the configuration section in the readme for more details.

And if you migrated from pocco81/auto-save.nvim, make sure you update the plugins and restart neovim. Otherwise lazy might still be using the old version of the plugin.

parik-shit commented 9 months ago

It started working, IDK what was the problem. Thanks.