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

Fix issue of auto save and auto format conflicting. #87

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wbjin
Copy link

@wbjin wbjin commented Apr 26, 2024

When auto save and auto format is turned on together, undo and redo does not work as expected because of a circular relationship. Consider this situation:

  1. A change is made
  2. Auto save saves this change
  3. Auto format formats the changed buffer
  4. Auto save saves this formatting

When you try to undo, you will undo the formatting after which auto save will save this undoing. This creates a circular relationship between auto save and auto format causing issues.

Fix this issue by not auto saving on an undo.

@primeapple
Copy link

Nice find! Would you mind sharing that on https://github.com/okuuva/auto-save.nvim ? It's the more maintained fork (disclaimer, I'm one of the maintainers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants