snacks.nvim icon indicating copy to clipboard operation
snacks.nvim copied to clipboard

bug: UI select picker doesn't use custom preset

Open MuntasirSZN opened this issue 7 months ago • 1 comments

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:

Image

My select one had a similar layout and colors some time ago, now it doesn't.

Image

Steps To Reproduce

  1. 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
  },
})

MuntasirSZN avatar May 19 '25 14:05 MuntasirSZN

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

Image

See the title "search" doesnt have my highlight, same for border.

MuntasirSZN avatar May 22 '25 09:05 MuntasirSZN

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.

github-actions[bot] avatar Jun 22 '25 02:06 github-actions[bot]

Nope

MuntasirSZN avatar Jun 22 '25 02:06 MuntasirSZN

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.

github-actions[bot] avatar Jul 30 '25 02:07 github-actions[bot]

No its not

MuntasirSZN avatar Jul 30 '25 06:07 MuntasirSZN

Now it has, weirdly.anyways...

MuntasirSZN avatar Jul 30 '25 06:07 MuntasirSZN