bug: UI select picker doesn't use custom preset
Did you check docs and existing issues?
- [x] I have read all the snacks.nvim docs
- [x] I have updated the plugin to the latest version before submitting this issue
- [x] I have searched the existing issues of snacks.nvim
- [x] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.11.1 Build type: RelWithDebInfo LuaJIT 2.1.1741730670 Run "nvim -V1 -v" for more info
Operating system/version
Archlinux
Describe the bug
My default picker:
My select one had a similar layout and colors some time ago, now it doesn't.
Steps To Reproduce
- Open anything that uses ui select.
Expected Behavior
It will use my custom layout (and my highlights as its custom).
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "folke/snacks.nvim", opts = {
picker = {
sources = {
matcher = {
frecency = true,
},
select = {
layout = {
preset = "telescope-custom-select",
},
},
},
ui_select = true,
enabled = true,
prompt = " ",
layout = {
preset = "telescope-custom",
},
layouts = {
["telescope-custom-select"] = {
reverse = false,
layout = {
box = "horizontal",
backdrop = false,
width = 0.5,
height = 2,
border = "none",
{
box = "vertical",
{ win = "input", height = 1, border = "rounded", title = "{title} {live} {flags}", title_pos = "center" },
{
win = "list",
title = " Results ",
title_pos = "center",
border = "rounded",
height = 30
},
},
},
},
["telescope-custom"] = {
reverse = false,
layout = {
box = "horizontal",
backdrop = false,
width = 0.8,
height = 0.9,
border = "none",
{
box = "vertical",
{ win = "input", height = 1, border = "rounded", title = "{title} {live} {flags}", title_pos = "center" },
{ win = "list", title = " Results ", title_pos = "center", border = "rounded" },
},
{
win = "preview",
title = "{preview:Preview}",
width = 0.53,
border = "rounded",
title_pos = "center",
},
},
},
},
},
} },
-- add any other plugins here
},
})
Another bug. The dropdown picker doesn't apply all hl groups, for example i have those set up:
local colors = require("catppuccin.palettes").get_palette()
local SnacksPickerColors = {
-- Matching and Selection
SnacksPickerMatch = { fg = colors.peach },
SnacksPickerSelected = { fg = colors.text, bg = colors.surface1, bold = true },
-- Prompt highlights
SnacksPickerInput = { bg = colors.surface1 },
SnacksPickerInputBorder = { bg = colors.surface1, fg = colors.surface1 },
SnacksPickerInputTitle = { bg = colors.red, fg = colors.mantle },
-- Results highlights
SnacksPickerList = { bg = colors.mantle },
SnacksPickerListBorder = { bg = colors.mantle, fg = colors.mantle },
SnacksPickerListTitle = { fg = colors.overlay2 },
-- Preview highlights
SnacksPickerPreview = { bg = colors.mantle },
SnacksPickerPreviewBorder = { bg = colors.mantle, fg = colors.mantle },
SnacksPickerPreviewTitle = { bg = colors.green, fg = colors.crust },
}
-- Apply highlights
for highlight_group, color_settings in pairs(SnacksPickerColors) do
vim.api.nvim_set_hl(0, highlight_group, color_settings)
end
See the title "search" doesnt have my highlight, same for border.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Nope
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
No its not
Now it has, weirdly.anyways...