Can't redo the changes after file saved
config:
{
'okuuva/auto-save.nvim',
config = function()
require("auto-save").setup {
execution_message = {
message = function()
return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
end,
dim = 0.18,
cleaning_interval = 500,
},
debounce_delay = 1500,
trigger_events = {
defer_save = { "InsertLeave" },
},
condition = function()
return not vim.g.VM_insert_mode -- Disable if in vim-visual-multi insert mode
end,
}
end,
}
I also had this issue with the original auto-save. When I have a line for example
asdasdasdasdasdasd; asdasdasdasdasdasd
When I try to press D in normal mode I cannot undo my changes only after pressing u multiple times.
But the interesting thing is that it's not always happening. When I manually save the file it happens more often. And the cursor also moves to the beginning of the line.
Also what I noticed, if I press :messages I can see the autosave log doubled for each auto-save. Maybe they're related?
Hi @marko1777 , sorry for this taking so long.
Could you try noautocmd = false in the config? My guess is that there is something listening on the save event of the buffer (autoformat?) which changes the buffer again. noautocmd fixes this.
If this is not working you could set debug = true which will write a log file of the autosaves. You could see in there if something looks weird.
@primeapple Thanks for looking into it.
Sorry for taking so long to answer, but after trying the noautocmd = false which didn't work I didn't have so much time to investigate.
Unfortunately, I cannot seem to find where auto-save is logging even though setting the debug level, or setting verbose for nvim, I cannot find any log in .local/share/nvim
Can you point me to the right direction where I could find the log files?
For me it's in .cache/nvim/
I saw this issue you are having in other issues as well in the original plugin: https://github.com/pocco81/auto-save.nvim/pull/87
Maybe it's related to auto-format?
Thanks for your help!
Yes, it was related to that issue.
But the issue was on my side..
I was surprised I couldn't find the logs in the directory you told me, but didn't know why, and yesterday I was updating my packages and realized that I used pocco81/auto-save in the past and when I changed to the okuuva I didn't clear my cache and I was using the previous version..
After I downloaded the okuuva version the issue was gone and everything worked as it should! :)
Rookie mistake.. Thanks for your help anyway
No worries, we've all been there.
We should add some basic upgrade/migration instructions to readme, and add a troubleshooting section Somewhereâ„¢ (Github Wiki? Readme? Somewhere Elseâ„¢?).
I'll create a ticket about it.