-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Putting over selection in visual mode does not yank deleted selection #1280
Comments
Tried to fix this myself by swapping the order of 'delete' and 'put' invocations, and enabling yank on delete, but it leaves the cursor in a bad position (at the start of pasted text instead of the end). Could somebody advise me how to achieve this idiomatically? |
ah this is a good catch, yea at least it wasn't yanking when deleting over the previous register in current master I think you are on the right track, can you just set vimState.cursorPosition = at the end? I think this is happening because the delete is pushing a transform that sets the cursor position that is not quite right, not sure... |
Just had another play around with this. I guess the problem is that I don't know what to set the cursor position to. |
I'll try to revisit this in the coming days, I'm sure it will keep annoying me. :) |
You can get the register length before doing anything? |
@rhys-vdw, I'm sorry I missed your questions earlier. The most reliable way to bug me in the future is to ping me on Slack. I try to be fairly responsive. :) |
Thanks @johnfn. I'm a bit busy to work on this PR for now. |
+1 This prevents my usual way of swapping key/values in js objects. |
Fixes #1280: Pasting over selection doesn't yank deleted section
Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.
What did you do?
Attempted to swap two words by using cut/paste in visual mode:
Commands:
dewvep0P
What did you expect to happen?
What happened instead?
Technical details:
The text was updated successfully, but these errors were encountered: