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(auto-insert): restore content of context instead of undo #953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xzbdmw
Copy link
Contributor

@xzbdmw xzbdmw commented Jan 8, 2025

fix #942
fix #810

Described in #942 (comment), this pr removes the preview_undo field and make the auto_insert stateless.

@xzbdmw xzbdmw force-pushed the auto-insert branch 2 times, most recently from 091b3ce to f9d4b20 Compare January 8, 2025 18:34
@xzbdmw xzbdmw marked this pull request as draft January 8, 2025 18:38
@xzbdmw xzbdmw marked this pull request as ready for review January 8, 2025 18:41
@xzbdmw
Copy link
Contributor Author

xzbdmw commented Jan 8, 2025

Blink has the same issue with nvim-cmp when used with mini.snippets, but should not related to this pr, I'd open a new one.

@xzbdmw xzbdmw marked this pull request as draft January 8, 2025 18:45
@xzbdmw
Copy link
Contributor Author

xzbdmw commented Jan 8, 2025

I feel this function is unnecessary (keep it a blank body also fix these two issues), we already handles text_edits smartly, it says TODO: doesnt work when the item contains characters not included in the context regex, but I have not find a condition this guess fails.

This pr sort of emulate the restore functionality by deleting chars until list.context.bounds.start_col

@xzbdmw xzbdmw marked this pull request as ready for review January 8, 2025 20: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
1 participant