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

Add pseudo_pending for ms/mr/md #3381

Closed

Conversation

AceofSpades5757
Copy link
Contributor

implements #3223

Adds pseudo pending text for ms/mr/md commands (match surround, replace, and delete).

Currently hard-coded as there appears to be an issue with appending to the current editor.pseudo_pending value.

  • Can leave it open to not be cleared on the next key press. Leaves lingering pseudo text.
  • Can append it, only to have it immediately cleared (appending in the target locations would be cleared immediately before appending).

@AceofSpades5757 AceofSpades5757 changed the title Hard-code pseudo_pending for ms/mr/md Add pseudo_pending for ms/mr/md Aug 10, 2022
@AceofSpades5757
Copy link
Contributor Author

It looks like pseudo_pending is affected by initial key maps such as <space>, or anything else opening an auto_info windows. I was unable to find where this is located, or how it is handled. If possible, it would have been nice to implement this same functionality for similar situations that wait on a key press, but that may be out of scope for this pr and issue.

@AceofSpades5757 AceofSpades5757 marked this pull request as ready for review August 11, 2022 01:07
@@ -4403,7 +4405,9 @@ fn surround_add(cx: &mut Context) {

fn surround_replace(cx: &mut Context) {
Copy link
Member

@the-mikedavis the-mikedavis Aug 14, 2022

Choose a reason for hiding this comment

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

Surround-replace has two cx.on_next_keys, one for the starting character and one for the replacement. Nested in the first cx.on_next_key, we should add the character from the event to the pseudo-pending and then clear it within the second

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I'll take a look at that.

@archseer archseer added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 2, 2022
@kirawi kirawi added A-keymap Area: Keymap and keybindings A-helix-term Area: Helix term improvements and removed A-keymap Area: Keymap and keybindings labels Sep 13, 2022
@AceofSpades5757 AceofSpades5757 deleted the pseudo-pend branch October 3, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants