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

Auto pairs selection #1254

Merged
merged 3 commits into from
Dec 21, 2021
Merged

Conversation

dead10ck
Copy link
Member

Previously, the auto pairs code was converting the user selection into its cursor form, and setting the transaction's selection to that cursor. This has the effect of destroying the user's selection if they type a pair character that gets auto completed.

This fixes the code to work with the user's selection, inserting auto pairs where appropriate, but either keeping or extending the user's selection.

This PR is built on top of #1219, so this PR includes commits from there as well until it is merged. I'll mark it as a draft until then.

@dead10ck dead10ck force-pushed the auto_pairs_selection branch 2 times, most recently from f32c80f to 78e4e83 Compare December 13, 2021 17:04
@dead10ck dead10ck marked this pull request as ready for review December 13, 2021 23:00
@dead10ck dead10ck force-pushed the auto_pairs_selection branch 4 times, most recently from fd668ed to 3f0f0e8 Compare December 15, 2021 13:01
@dead10ck dead10ck force-pushed the auto_pairs_selection branch 2 times, most recently from 9857aca to 3e471e4 Compare December 19, 2021 05:47
@dead10ck
Copy link
Member Author

@archseer is there anything else you'd like before this is merged?

helix-core/src/selection.rs Outdated Show resolved Hide resolved
helix-core/src/auto_pairs.rs Outdated Show resolved Hide resolved
helix-core/src/selection.rs Outdated Show resolved Hide resolved
Previously, the auto pairs code was converting the user selection into
its cursor form, and setting the transaction's selection to that cursor.
This has the effect of destroying the user's selection if they type a
pair character that gets auto completed.

This fixes the code to work with the user's selection, inserting auto
pairs where appropriate, but either keeping or extending the user's
selection.
@archseer archseer merged commit 5b4540f into helix-editor:master Dec 21, 2021
@dead10ck dead10ck deleted the auto_pairs_selection branch December 21, 2021 21:01
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