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

The "sticky" option doesn't seem to work #487

Open
Penguin-jpg opened this issue Sep 21, 2024 · 3 comments
Open

The "sticky" option doesn't seem to work #487

Penguin-jpg opened this issue Sep 21, 2024 · 3 comments

Comments

@Penguin-jpg
Copy link

I tested the sticky option and found that it didn't affect the cursor position, whether it was true or false.
Below is my config for Comment.nvim:
image
(I am using neovim 0.10.0 and the latest version of Comment.nvim .)

What I want to achieve is something like this:

-- "^" means the current cursor position.

-- Before comment
apple
^
-- After comment
-- apple
   ^

What I encounter:

-- Before comment
apple
^
-- After comment
-- apple
^
@windowsrefund
Copy link

Seems to be 2 issues here which look quite different depending on whether a line comment was used or something like a gcap orgcip. As mentioned above, the cursor will maintain the original line+column position on when a gcc is used.

The same is true when a gcip is used. However, an immediate undo u will jump the cursor to the first line and first column of the paragraph (this was not the original position of the cursor).

Either way, we're clearly not sticking but I figure this "jump" behavior is worth calling out.

@Penguin-jpg
Copy link
Author

Penguin-jpg commented Jan 2, 2025

Thank you for the explanation. I think maybe I misunderstands the meaning the sticky option. I'm sorry for the ambiguity. I think what I use in the example is gcc.
What I want to achieve is more like the comment function in vscode, where the cursor stays at the character I am hovering, not the original position of the cursor.

@windowsrefund
Copy link

Yep, I'd like that as well but could live with it persisting the original position if needed. What I do find utterly annoying is the "jump" I've described when performing against an object other than a simple line. Hopefully this will be an easy fix.

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