Skip to content

bug: plugin and pattern is mutually exclusive for icons.rules #1028

Description

@MunifTanjim

Did you check docs and existing issues?

  • I have read all the which-key.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of which-key.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.12.0-dev-1134+g79bfeecdb4-Homebrew

Operating system/version

MacOS

Describe the bug

{ plugin = "telescope.nvim", pattern = "telescope", icon = "", color = "blue" },

Having both plugin and pattern for an icon rule doesn't combine them. If plugin exists, pattern is completely ignored.

if icon.plugin == plugin then
local ico, hl = M.get_icon(icon)
if ico then
return ico, hl
end
end

Steps To Reproduce

    icons = {
      rules = {
        { plugin = "claudecode.nvim", icon = "" },
        { plugin = "claudecode.nvim", pattern = "toggle", icon = "󰨚", color = "yellow" },
      },
    },

Expected Behavior

I want diffrent keymaps inside claudecode.nvim to have different icons and also claudecode.nvim group itself to have an icon.

Health


Log


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/which-key.nvim", opts = {} },
    -- add any other plugins here
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions