fix(picker.select): allow configuring vim.ui.select with the select source. Closes #776

This commit is contained in:
Folke Lemaitre 2025-01-29 12:49:18 +01:00
parent 1f648b1094
commit d70af2d253
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 14 additions and 6 deletions

View file

@ -29,15 +29,12 @@ function M.select(items, opts, on_choice)
return Snacks.picker.pick({
source = "select",
items = finder_items,
main = { current = true },
format = Snacks.picker.format.ui_select(opts.kind, #items),
title = title,
layout = {
preset = "select",
preview = false,
layout = {
height = math.floor(math.min(vim.o.lines * 0.8 - 10, #items + 2) + 0.5) + 10,
title = " " .. title .. " ",
title_pos = "center",
},
},
actions = {