Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use okuuva/auto-save.nvim instead of Pocco81/auto-save.nvim #1233

Closed
srghma opened this issue Oct 6, 2024 · 2 comments · Fixed by #1239
Closed

use okuuva/auto-save.nvim instead of Pocco81/auto-save.nvim #1233

srghma opened this issue Oct 6, 2024 · 2 comments · Fixed by #1239
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@srghma
Copy link

srghma commented Oct 6, 2024

Is your feature related to a problem?

not maintained

Describe the new feature

https://github.com/okuuva/auto-save.nvim is more maintained

Additional context

use https://github.com/okuuva/auto-save.nvim?tab=readme-ov-file#%EF%B8%8F--events--callbacks

instead of before_saving, after_saving?

but I cannot test - dont use formatters and save on insertLeave

my config is

  {
    "okuuva/auto-save.nvim",
    event = { "User AstroFile", "InsertEnter" },
    opts = {
      trigger_events = { -- See :h events
        immediate_save = { 'BufLeave', 'TabLeave', 'FocusLost', 'VimLeavePre' }, -- vim events that trigger an immediate save
        -- defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
        defer_save = { }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
        cancel_defered_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
      },
    },
  },
@srghma srghma added the enhancement New feature or request label Oct 6, 2024
@Uzaaft Uzaaft added the good first issue Good for newcomers label Oct 6, 2024
@ALameLlama
Copy link
Contributor

I just had a quick test, and I don't think the current callback stuff even works. I have lua enabled with auto formatting, I created a bunch of extra spaces and let it autosave and it will remove the extra spaces. If I manually disable auto formatting for my buffer and then do the same thing, it will keep the spaces.

Are we happy with me just updating the repo and removing the callback stuff? or should I look into why this might be happening?

@ALameLlama
Copy link
Contributor

Figured it out it's because we're looking at autoformat_enabled while it should be autoformat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants