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
4.75k stars 154 forks source link

fix(util): replace multichar leaders correctly #620

Closed TheBlob42 closed 3 hours ago

TheBlob42 commented 6 days ago

If vim.g.mapleader or vim.g.maplocalleader have more than one character the replacement in the notation does not work correctly (only replacing one char) which then leads to an error as the length between the internal representation and notation does not match. This is also the issue for https://github.com/folke/which-key.nvim/issues/450

Now in case of any (local)leader having multiple characters we replace them in a loop to ensure that everything matches

TheBlob42 commented 6 days ago

Rebased version of #492

folke commented 3 hours ago

fixed in v3