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

copy_visual does not respect reselect-visual (gv) #18

Closed
wookayin opened this issue May 11, 2023 · 2 comments
Closed

copy_visual does not respect reselect-visual (gv) #18

wookayin opened this issue May 11, 2023 · 2 comments

Comments

@wookayin
Copy link

When pressing gv (:help reselect-visual), it should reselect the copied region (visual block).

Reproduction:

      vim.keymap.set('v', '<leader>y', require('osc52').copy_visual)
  • visual select some text
  • <leader>y (osc52.copy_visual)
  • move cursor
  • gv
  • The same visual region should be selected again, but it doesn't.

Some codes like the following would be needed:

local start = vim.fn.getpos("'<")
local end = vim.fn.getpos("'>")

-- copy OSC52...

vim.fn.setpos("'<", start)
vim.fn.setpos("'>", end)
@ojroques
Copy link
Owner

Thanks for the report, it should be fixed in the latest commit.

@wookayin
Copy link
Author

Awesome, thanks!

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

2 participants