Skip to content

Add support for updating a register on quick access menu selection - #31

Merged
ptdewey merged 4 commits into
ptdewey:mainfrom
reshen:main
Sep 1, 2026
Merged

ptdewey merged 4 commits into
ptdewey:mainfrom
reshen:main

Conversation

@reshen

@reshen reshen commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

When I select an item from the quick access menu, I'd like to be able to paste that item consecutively without re-entering the menu. This is now available with the optional paste_register setting. As the default value for paste_register is nil, this change will not affect existing user's workflows.

Thanks for this plugin, it's great!

When I select an item from the quick access menu, I'd like to be able
to paste that item consecutively without re-entering the menu. This
is now available with the optional paste_register setting. As the
default value for paste_register is nil, this change will not affect
existing user's workflows.
@reshen
reshen marked this pull request as ready for review August 31, 2026 18:28

@ptdewey ptdewey left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the contribution and I'm glad you like the plugin!
I'm happy to merge this after a few small changes are made.

Thanks!

Comment thread lua/yankbank/pickers/snacks.lua Outdated
Comment thread lua/yankbank/helpers.lua Outdated
Comment thread lua/yankbank/pickers/snacks.lua
- preserve the reg_type to make sure block-wise yanks don't become character-wise
- snacks picker guard against empty selections:
- bug fix - ensure snacks picker selection always pastes
@reshen

reshen commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Hey Patrick,

Thanks for the feedback! Incorporated your suggestions and fixed a bug I introduced in the snacks picker (pasting the selected, non-empty item shouldn't be conditional).

Two other issues, unrelated to this PR:

  1. While in snacks.lua, I noticed a usability problem with the snacks picker generally. Since the picker has format = "register", snacks items appear like [3] foobaz. That register prefix ([3]) is probably useful to some folks, but for me, I found it awkward/noisy since I couldn't just enter 3 to quick filter down to that item. Curious if you've got any strong preferences on that, in my fork I may just change it to format = "text".
  2. When I set sep = "", the quick access menu displays correctly but entering a number to jump to an item is broken, e.g., entering 4 jumps to item 7. I may try to run that down.

cheers,
reshen

@ptdewey

ptdewey commented Sep 1, 2026

Copy link
Copy Markdown
Owner

... Incorporated your suggestions and fixed a bug I introduced in the snacks picker (pasting the selected, non-empty item shouldn't be conditional).

👍

  1. While in snacks.lua, I noticed a usability problem with the snacks picker generally. Since the picker has format = "register", snacks items appear like [3] foobaz. That register prefix ([3]) is probably useful to some folks, but for me, I found it awkward/noisy since I couldn't just enter 3 to quick filter down to that item. Curious if you've got any strong preferences on that, in my fork I may just change it to format = "text".

I don't use snacks (and the integration was contributed by someone else), but I think I'd be inclined to remove the noisy numbers by default. (maybe worth making that a config option, but idk -- probably fine to just add one if someone asks for that behavior back).

Feel free to open another PR with that change if you get around to it.

@ptdewey

ptdewey commented Sep 1, 2026

Copy link
Copy Markdown
Owner

When I set sep = "", the quick access menu displays correctly but entering a number to jump to an item is broken, e.g., entering 4 jumps to item 7. I may try to run that down.

I don't think I've tested that combination of options, and that definitely is not the intended behavior there. I'd be happy to accept a PR for that as well if you track down what causes that.

@ptdewey
ptdewey merged commit d23b317 into ptdewey:main Sep 1, 2026
2 checks passed
@reshen reshen mentioned this pull request Sep 1, 2026
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

Successfully merging this pull request may close these issues.

2 participants