Closed sameer1612 closed 9 months ago
@okuuva this is pretty much same configs as mentioned in the readme. can you please check the trigger events in my setup
@sameer1612 I'll try to do some debugging tomorrow but I'd say you want BufLeave as the trigger event instead of BufHidden. You could also try setting defer_save and cancel_defer_save to nil instead of an empty table.
I can not reproduce your problems @sameer1612, your setup works for me. Could you do a screencast with the debug window open? (tail -f ~/.cache/nvim/auto-save.log
, with debug
set to true
?)
What is your version? (see lazy-lock.json
file)
I can not reproduce your problems @sameer1612, your setup works for me. Could you do a screencast with the debug window open? (
tail -f ~/.cache/nvim/auto-save.log
, withdebug
set totrue
?)What is your version? (see
lazy-lock.json
file)
sure @primeapple . My requirement: I want my file to be saved whenever I move to some other buffer. (Not when my buffer content changes)
No logs found! (@okuuva I have your suggested changes and restarted as well)
From lazy lock file:
"auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" },
Screencast here:
Yeah, your problem is that you are still on the old fork. Lazy didn't recognize that, because the plugins names are the same. This should by brought up to https://github.com/folke/lazy.nvim
For now, what you can do is to comment out the entire auto-save.lua
file, resync, check that the line in lazy-lock.json
got deleted. Now readd it and it should fetch the right repository.
Yeah, your problem is that you are still on the old fork. Lazy didn't recognize that, because the plugins names are the same. This should by brought up to https://github.com/folke/lazy.nvim
For now, what you can do is to comment out the entire
auto-save.lua
file, resync, check that the line inlazy-lock.json
got deleted. Now readd it and it should fetch the right repository.
I tried your suggested steps. But, the lock file shows the latest commit from this repo.
"auto-save.nvim": { "branch": "main", "commit": "610e72307d675fcc15098c5a435ad89e45aaf855" }
Commit hash checks out:
Ok, so now you are on the correct commit. Before you had
"auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" },
Please try if it works now.
Ok, so now you are on the correct commit. Before you had
"auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" },
Please try if it works now.
Negative. ☹️
Does debugging work now?
@sameer1612 One thing I spotted now in the config is that you have debounce_delay
set to 0. That's known to cause some problems. Since you're only using immediate_save
you can leave it to the default value of 1000.
I'm having the same issue on neovim 0.9.5, the changes are saved immediately after exiting from edit mode or right after making a change (ie iabc<esc>
) or navigating after a change (ddj
). I'm using default config and lazyvim
[Wed Jan 10 09:59:33 2024] [/home/alex/.config/nvim/lua/plugins/example.lua] - Abort saving buffer
[Wed Jan 10 09:59:43 2024] [/home/alex/.config/nvim/lua/plugins/ide.lua] - Should save buffer
[Wed Jan 10 09:59:43 2024] [/home/alex/.config/nvim/lua/plugins/ide.lua] - Abort saving buffer
[Wed Jan 10 10:00:00 2024] [/home/alex/.config/nvim/lua/plugins/ide.lua] - Should save buffer
[Wed Jan 10 10:00:00 2024] [/home/alex/.config/nvim/lua/plugins/ide.lua] - Timer started
[Wed Jan 10 10:00:01 2024] [/home/alex/.config/nvim/lua/plugins/ide.lua] - Abort saving buffer
nvm, realized that defer_save = { "InsertLeave", "TextChanged" }
was my problem, changing it to {}
got me desired results.
It is saving whenever I make any change in the buffer, (x, D, insert, etc). I just want it to save when current buffer gets hidden, as in being replaced by another file I open with telescope.