folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.12k stars 163 forks source link

bug: The key "cS" in the Plug "kylechui/nvim-surround" is not valid #777

Closed HeraPtt closed 1 month ago

HeraPtt commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

ubuntu22.04

Describe the bug

The key "cS" in the Plug "kylechui/nvim-surround" is not valid, if I change the "S" to other char with the lower case, the keymap becomes OK, but if I change the "S" to other char with the capital case, It is still invalid

Steps To Reproduce

  1. Install the Plug "kylechui/nvim-surround";
  2. The default configuration of keys is as follows: keymaps = { change = "cs", change_line = "cS", },
  3. The key "cs" is to change the surrounds, and the key "cS" is to change the surrounds in new line;
  4. "cs" is normal; but "cS" is invalid, if I change the "cS" to new map such as "cO", it is stiil invalid;
  5. But if I change the second char "S" to any char with the lower case, it becomes OK

Expected Behavior

the default configuration of the "nvim-surround" is valid.

Health

which-key: require("which-key.health").check()

- OK Most of these checks are for informational purposes only.
  WARNINGS should be treated as a warning, and don't necessarily indicate a problem with your config.
  Please |DON't| report these warnings as an issue.

Checking your config ~
- WARNING |mini.icons| is not installed
- OK |nvim-web-devicons| is installed

Checking for issues with your mappings ~
- OK No issues reported

checking for overlapping keymaps ~
- WARNING In mode `n`, <gc> overlaps with <gco>, <gcc>, <gcO>, <gcA>:
  - <gc>: Comment toggle linewise
  - <gco>: Comment insert below
  - <gcc>: Comment toggle current line
  - <gcO>: Comment insert above
  - <gcA>: Comment insert end of line
- WARNING In mode `n`, <gb> overlaps with <gbc>:
  - <gb>: Comment toggle blockwise
  - <gbc>: Comment toggle current block
- OK Overlapping keymaps are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Checking for duplicate mappings ~
- WARNING Duplicates for <<leader>s> in mode `n`:
  * Write: `{ rhs = "<cmd>w<cr>", silent = true }`
  * save: `{ group = true }`
- OK Duplicate mappings are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Log

I enable logging as follow, But I can't find the file wk.log, in current path
    opts = {
        -- your configuration comes here
        -- or leave it empty to use the default settings
        -- refer to the configuration section below
        debug = true,
        modes = {
            n = true, -- Normal mode
            i = true, -- Insert mode
            x = true, -- Visual mode
            s = true, -- Select mode
            o = true, -- Operator pending mode
            t = true, -- Terminal mode
            c = true, -- Command mode
            -- Start hidden and wait for a key to be pressed before showing the popup
            -- Only used by enabled xo mapping modes.
            -- Set to false to show the popup immediately (after the delay)
            defer = {
                ["<C-V>"] = true,
                V = true,
            },
        },
    },

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
  },
})
folke commented 1 month ago

I don't use nvim-surround, so please update the repro and steps to reproduce if you want me to look at it.

folke commented 1 month ago

And what do you mean with invalid?

folke commented 1 month ago

You're also using an old version of which-key. Closing for now, since your issue is most likely already fixed.