yanky.nvim icon indicating copy to clipboard operation
yanky.nvim copied to clipboard

feat: Add timer option to preserve cursor position functionality

Open marcoSven opened this issue 10 months ago • 3 comments

This commit introduces an optional parameter, 'timer', to the 'preserve_cursor_position' feature. The inclusion of this parameter helps prevent a potentially jarring cursor jump after a lengthy multiline yank operation with a downwards motion.

marcoSven avatar Apr 05 '24 12:04 marcoSven

Thanks for this PR !

I'm currently on vacation and I can't test and review this for the moment. I'll do this when I come back 😅

gbprod avatar Apr 05 '24 17:04 gbprod

No worries no rush - enjoy you vacation!

Here are my configs


highlight = {
on_put = true,
on_yank = true,
timer = 500,
},
preserve_cursor_position = {
enabled = true,
timer = 458,
},

A possible additional improvement, for another PR, could be to conditionally jump back immediately if only one line is yanked.

marcoSven avatar Apr 05 '24 17:04 marcoSven

Hey, Sorry for the late answer. Can you add a description of this option in the README here : https://github.com/gbprod/yanky.nvim/blob/main/README.md?plain=1#L507 and add the option here : https://github.com/gbprod/yanky.nvim/blob/main/README.md?plain=1#L497 Otherwise, it seems ok :)

gbprod avatar Apr 29 '24 07:04 gbprod