Registry Mirror
Skip to content

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

Open

Description

@Penguin-jpg

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
^

Activity

  1. windowsrefund commented on Jan 1, 2025

    @windowsrefund

    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.

  2. Penguin-jpg commented on Jan 2, 2025

    @Penguin-jpg
    Author

    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.

  3. windowsrefund commented on Jan 2, 2025

    @windowsrefund

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions