You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
(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
^
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.
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.
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.
Activity
windowsrefund commentedon Jan 1, 2025
Seems to be 2 issues here which look quite different depending on whether a line comment was used or something like a
gcaporgcip. As mentioned above, the cursor will maintain the original line+column position on when agccis used.The same is true when a
gcipis used. However, an immediate undouwill 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 commentedon 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 commentedon Jan 2, 2025
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.