Skip to content

Off-by-one in counsel-yank-pop selection #1371

Closed
@ambihelical

Description

@ambihelical

If I understand the recent changes correctly, the current kill-ring-yank-pointer position should be preselected. This seems to always be one off. If I have three lines which I've killed in order:

one
two
three

After killing "one", the counsel-yank-pop shows "one" and it is preselected.
After killing "two":

    two <- should be selected
    one <- selected

After killing "three":

    three  <- should be selected
    two  <- selected
    one

When I use the "rotate" command to change the current kill-ring-yank-pointer, it never sets the selection to the item selected, but is always one off. If I select "three", and use rotate (M-o r) to set the pointer, the next counsel-yank-pop shows "two" selected. If I select "two" and rotate, the next counsel-yank-pop shows "one" selected. If I select "one", the next invocation shows "three" selected.

For this issue I was using commit 5c096a2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions