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: prevent buffer jump when safe strategy fails #96

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

AjaiKN
Copy link
Contributor

@AjaiKN AjaiKN commented Jun 24, 2024

When replace-buffer-contents fails to do a non-destructive replacement within the allotted time/cost, it basically follows the fast strategy, except unlike the fast strategy, it doesn't try to prevent the window from jumping.

So in addition to doing the window adjustment in the fast strategy, we can also do it for the safe strategy when it fails and returns nil.

When `replace-buffer-contents` fails to do a non-destructive replacement
within the allotted time/cost, it basically follows the `fast` strategy,
except unlike the `fast` strategy, it doesn't try to prevent the window
from jumping.

So in addition to doing the window adjustment in the `fast` strategy, we
also do it for the `safe` strategy when it fails and returns `nil`.
@justinbarclay
Copy link
Owner

Hey, this looks great. Thanks for the PR 😄

@justinbarclay justinbarclay merged commit bff89fa into justinbarclay:main Jun 25, 2024
1 check passed
@AjaiKN AjaiKN deleted the when-safe-strategy-fails branch June 25, 2024 21:10
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.

2 participants