Skip to content

Conversation

MGessinger
Copy link

What this PR does / why we need it:

This PR adds extends the :display command, so that the QuickPick which opens to show the registers also offers action buttons to paste the register content. This is equivalent to running :di, followed by :put with the selected register. While the functionality is not new per se, it makes the QuickPick of the registers slightly more useful.

In order to do this, most of the changes are within registers.ts but some small changes were made to the Register class as well. These are convenience functions, and they do not alter any existing functionality.

Which issue(s) this PR fixes

I couldn't find an issue which talks about this feature. If a linked issue is required, I can open one afterwards and discussion can happen there, but at least for me this feature would improve my productivity greatly.

Special notes for your reviewer:

I know it's a mouse action rather than a keyboard action. The Vim gods shall have mercy on my soul.

}

private static async paste(vimState: VimState, item: RegisterDisplayItem) {
// TODO: Can I reuse PutCommand here?
Copy link
Author

Choose a reason for hiding this comment

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

This paste method feels wrong. I don't want to have to reinvent the wheel just to actually paste register content. I would like to reuse existing functionality, but I couldn't figure out the correct way to do that.

What I tried was to create an instance of PutCommand here and pass it the register key as part of its arguments, but somehow that didn't give me the desired result (I had to press ESC after clicking the paste button, for the text to show up).

Perhaps someone can give me some pointers for how to implement this properly.

@MGessinger MGessinger marked this pull request as ready for review August 19, 2025 20:52
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.

1 participant