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

Support replacing selection with paste in Visual mode #85

Closed
ulyssa opened this issue Jan 17, 2023 · 0 comments
Closed

Support replacing selection with paste in Visual mode #85

ulyssa opened this issue Jan 17, 2023 · 0 comments
Assignees

Comments

@ulyssa
Copy link
Owner

ulyssa commented Jan 17, 2023

The current InsertAction::Paste behaviour is to paste register contents before or after the cursor. However, when pasting in Vim's Visual mode, the register contents should replace the current selection. I'm going to make InsertAction::Paste take a new PasteStyle type, which will allow specifying what type of behaviour to do:

  • PasteStyle::Cursor: Paste contents before the cursor, forcing the contents into TargetShape::CharWise
  • PasteStyle::Side(MoveDir1D): Paste contents before or after the current selection, respecting the register's shape
  • PasteStyle::Replace: Replace the current selection with the register contents, forced into TargetShape::CharWise

This will also help with representing Kakoune's p, P, and R keybindings in #32.

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

No branches or pull requests

1 participant