feat: add new snacks picker extension#145
feat: add new snacks picker extension#145kyerpotts wants to merge 1 commit intoThePrimeagen:masterfrom
Conversation
9bcafce to
f87e41a
Compare
| snacks = { | ||
| on_show = function(picker) | ||
| picker.list:view(index_of(models, current)) | ||
| end, |
There was a problem hiding this comment.
on_show nested under wrong key, never invoked
Medium Severity
The on_show callback is nested inside a snacks key in the opts table passed to snacks.picker.select. The snacks picker API expects on_show as a top-level option in the picker config — there's no documented support for a nested snacks key. This means on_show is silently ignored, so the cursor won't scroll to the currently selected model/provider, unlike the telescope and fzf_lua implementations.
Additional Locations (1)
There was a problem hiding this comment.
Pure unadulterated baloney.
See line 73 at https://github.com/folke/snacks.nvim/blob/main/lua/snacks/picker/select.lua if you're hungry for deli meat.
feat: add snacks picker extension The added snacks picker follows the same item selection behaviour as telescope; the selected item will be highlighted the list, but the order of items will not be changed. This is in line with common snacks use patterns. refactor: move the shared behaviour of index_of to pickers.lua
a15b14a to
4f149c6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| snacks = { | ||
| on_show = function(picker) | ||
| picker.list:view(pickers_util.index_of(models, current)) | ||
| end, |
There was a problem hiding this comment.
Snacks picker view scrolls viewport but doesn't select item
Medium Severity
picker.list:view(index) in snacks.nvim manages the visible viewport scroll position, not the cursor/selection. Unlike telescope's default_selection_index which pre-selects the item, this only scrolls the list to make the current model/provider visible without actually highlighting or selecting it. The cursor likely remains on the first item, making the pre-selection UX inconsistent with the telescope and fzf_lua pickers.
Additional Locations (1)
There was a problem hiding this comment.
@ThePrimeagen this is horsepoop, the bugbot couldn't tell snakes from spaghetti in this case. I've verified the behaviour as working correctly
|
This competes with #160 is there a way a user of snacks can use that vim.ui.select api instead? |


Added support for the popular snacks picker. Snacks can now be selected as a picker by following the same config patterns as fzf_lua & telescope
Note
Low Risk
Adds a new optional extension and a small utility refactor; changes are localized to picker UI behavior with minimal impact on core functionality.
Overview
Adds a new
snacks.nvimpicker extension (extensions/snacks.lua) that lets users pick the current model or provider viasnacks.picker.select, including dependency checks and preselecting the current choice.Refactors shared selection logic by moving
index_ofintoextensions/pickers.luaand updating the Telescope extension to use the shared helper fordefault_selection_index.Written by Cursor Bugbot for commit a15b14a. This will update automatically on new commits. Configure here.