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

ViMode: Yanking until given character #3735

Open
1 task done
Konstantin-Glukhov opened this issue Jul 7, 2023 · 5 comments
Open
1 task done

ViMode: Yanking until given character #3735

Konstantin-Glukhov opened this issue Jul 7, 2023 · 5 comments
Labels
Issue-Enhancement It's a feature request. VI-Mode

Comments

@Konstantin-Glukhov
Copy link

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

Yanking until given character for -ViMode Command

Proposed technical implementation details (optional)

<y,t> ViYankToBeforeChar Yanks until given character forward.
<y,T> ViYankToBeforeCharBackward Yanks until given character backward.
<y,f> ViYankToChar Yanks inclusively until given character forward.
<y,F> ViYankToCharBackward Yanks inclusively until given character backward.

@Konstantin-Glukhov Konstantin-Glukhov added the Issue-Enhancement It's a feature request. label Jul 7, 2023
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jul 7, 2023
@StevenBucher98 StevenBucher98 removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Aug 21, 2023
@matteocoder
Copy link

matteocoder commented Nov 3, 2023

If one wanted to implement this functionality using only methods from PSReadline, how would you programmatically access the register which is used in command mode to store the yanked text? I mean in the same way one can access the kill ring using only the psconsolereadline class.

@Konstantin-Glukhov
Copy link
Author

I am not sure. How are y0 and y$ implemented? Shouldn't be the same? First find a position of the searched character and then yank from current position to the found position?

@matteocoder
Copy link

@Konstantin-Glukhov Thanks for the reply. My problem in particular is that I cannot find, looking at the documentation, a psreadline method like

[Microsoft.PowerShell.PSConsoleReadLine]::ViPlaceThisStringInTheViClipboard(<string>)

Implementing the motions seems already possible with the available methods, but it seems it is not possible to directly access the place where text is yanked. I'm happy to be proven wrong, though.

@Konstantin-Glukhov
Copy link
Author

Did you find how <y,$> is implemented?

@matteocoder
Copy link

matteocoder commented Nov 7, 2023

Not yet. I know nothing about C#, so it's kind of hard for me.

EDIT: the text is pasted to a private _viRegister, so it seems like it's not accessible from outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement It's a feature request. VI-Mode
Projects
None yet
Development

No branches or pull requests

3 participants