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

feat: Add timer option to preserve cursor position functionality #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcoSven
Copy link
Contributor

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.

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.

Signed-off-by: marcoSven <[email protected]>
@gbprod
Copy link
Owner

gbprod commented Apr 5, 2024

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 😅

@marcoSven
Copy link
Contributor Author

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.

@gbprod
Copy link
Owner

gbprod commented Apr 29, 2024

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 gbprod added the bug Something isn't working label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants