pocco81 / auto-save.nvim

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

Can't redo the changes after file saved #70

Open belogermanotta opened 1 year ago

belogermanotta commented 1 year ago

Config:

{
    "Pocco81/auto-save.nvim",
    debounce_delay = 1000,
    config = function()
      require("auto-save").setup()
    end,
}

I can press u to undo if I hold it for a while, but I can't press redo (ctrl + r) to get the previous changes

mslauson commented 1 year ago

Yeah, I came here searching for a solution for undo.I have to press undo (u) about 10 times in a second for it to let me undo one thing

primeapple commented 1 year ago

Please provide your exact config. The one posted by @belogermanotta clearly is not correct (the debounce_delay key should go into the setup function).

SpacewaIker commented 1 year ago

I have the same issue with undo. It seems to be an issue with autosave + auto format on save. For instance, deleting a line with dd triggers autosave which triggers auto-format which triggers autosave. Then u undoes the auto-format, but that also triggers autosave which re-triggers autosave. Something like that anyway.

lunics commented 8 months ago

It happens when deleting "world" from "Hello world", the "world" will be removed then saved then the space will be automatically removed then saved again. Is there a way to delay every save of 1s for example ?

linkarzu commented 4 months ago

I have the same issue with undo. It seems to be an issue with autosave + auto format on save. For instance, deleting a line with dd triggers autosave which triggers auto-format which triggers autosave. Then u undoes the auto-format, but that also triggers autosave which re-triggers autosave. Something like that anyway.

That makes sense, did you figure something out or just stopped using the plugin @SpacewaIker?

linkarzu commented 4 months ago

Ok, I basically switched to okuuva/auto-save.nvim and now my undo/redo issues are gone, I'm using the lazyvim.org distro by the way, which autoformats by default (and I love it)