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

Save an undo checkpoint before accepting completion #7747

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

the-mikedavis
Copy link
Member

See #7643 (comment)

When you accidentally accept the wrong completion candidate and then go to normal mode and undo, the whole insert is undone which feels like too much. We can save an undo checkpoint when accepting a completion of the text before the completion takes effect so that the undo window is smaller.

I'm not sure if this is too granular or not: if you use completions frequently this can introduce many undo points.

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer. S-needs-discussion Status: Needs discussion or design. labels Jul 26, 2023
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes a lot of sense 👍 Nvim completion plugins usually work the same

@archseer archseer merged commit 6a431af into master Jul 27, 2023
@archseer archseer deleted the undo-checkpoint-on-completion branch July 27, 2023 02:48
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much S-needs-discussion Status: Needs discussion or design. S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants