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: recursion when settings up hydra? #811

Open Ajaymamtora opened 1 month ago

Ajaymamtora commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10 stable

Operating system/version

Macos 14.5

Describe the bug

Trying to replicate hydra with ;D but invoking it causes a loop?

Steps To Reproduce

Add a key which invokes hydra, where the sub actions start with the same as the hydra key. I dont see how I would do this otherwise?

Expected Behavior

The hydra popup opens and doesn't complain about recursion

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`, <<> overlaps with <<<>:
  - <<>: Indent left
- WARNING In mode `n`, <y> overlaps with <yq>, <ys>, <yss>, <yS>, <ySS>:
  - <y>: Yank text
  - <yq>: ο€½ Yank Macro
  - <ys>: Add a surrounding pair around a motion (normal mode)
  - <yss>: Add a surrounding pair around the current line (normal mode)
  - <yS>: Add a surrounding pair around a motion, on new lines (normal mode)
  - <ySS>: Add a surrounding pair around the current line, on new lines (normal mode)
- WARNING In mode `n`, <#> overlaps with <##>:
  - <#>: Search word and go previous
  - <##>: ο€½ Insert Macro Breakpoint.
- WARNING In mode `n`, <=> overlaps with <=P>, <=p>, <==>:
  - <=P>: YankyPutBeforeFilter
  - <=p>: YankyPutAfterFilter
- WARNING In mode `n`, <>> overlaps with <>>>:
  - <>>: Indent right
- WARNING In mode `n`, <;D> overlaps with <;D<M-8>>, <;D<M-2>>, <;D<M-1>>, <;D<M-0>>, <;D<M-9>>, <;D<C-C><C-C>X>, <;D<C-C><C-C>p>, <;D<C-C><C-C>f>, <;D<C-C><C-C>q>, <;D<C-C><C-C>g>, <;D<C-C><C-C>c>, <;D<C-C><C-C>x>, <;D<C-C><C-L>>, <;D<M-7>>, <;D<M-6>>, <;D<M-5>>, <;D<M-4>>, <;D<M-3>>:
  - <;D>: Breakpoint toggle
  - <;D<M-8>>: Close
  - <;D<M-2>>: Continue
  - <;D<M-1>>: Breakpoint toggle
  - <;D<M-0>>: Toggle repl
  - <;D<M-9>>: Restart
  - <;D<C-C><C-C>X>: Breakpoints clear
  - <;D<C-C><C-C>p>: Pause
  - <;D<C-C><C-C>f>: Dap local config
  - <;D<C-C><C-C>q>: UI close
  - <;D<C-C><C-C>g>: Get session
  - <;D<C-C><C-C>c>: Run to cursor
  - <;D<C-C><C-C>x>: Disconnect
  - <;D<C-C><C-L>>: Lua dap launch
  - <;D<M-7>>: Down
  - <;D<M-6>>: Up
  - <;D<M-5>>: Step out
  - <;D<M-4>>: Step over
  - <;D<M-3>>: Step into
- WARNING In mode `n`, <gb> overlaps with <gbc>:
  - <gb>: Comment toggle blockwise
  - <gbc>: Comment toggle current block
- WARNING In mode `n`, <gc> overlaps with <gcA>, <gcc>, <gcO>, <gco>:
  - <gc>: Comment toggle linewise
  - <gcA>: Comment insert end of line
  - <gcc>: Comment toggle current line
  - <gcO>: Comment insert above
  - <gco>: Comment insert below
- WARNING In mode `n`, <cx> overlaps with <cxx>:
  - <cx>: Exchange operator
  - <cxx>: Exchange operator
- WARNING In mode `n`, <cz> overlaps with <czz>:
  - <cz>: Substitute operator
  - <czz>: Substitute line
- WARNING In mode `i`, <<C-W>> overlaps with <<C-W>F>, <<C-W>N>, <<C-W>c>, <<C-W>C>, <<C-W><Right>>, <<C-W>d>, <<C-W>e>, <<C-W><Up>>, <<C-W>M>, <<C-W>a>, <<C-W><Down>>, <<C-W>u>, <<C-W>[>, <<C-W><Left>>, <<C-W>]>, <<C-W>W>, <<C-W>t>, <<C-W>m>, <<C-W>n>, <<C-W>R>, <<C-W>P>:
  - <<C-W>>: Window
  - <<C-W>F>: Close float windows
  - <<C-W>N>: Move buffer to next tab
  - <<C-W>c>: Close all visible windows
  - <<C-W>C>: Close all buffers
  - <<C-W><Right>>: Swap buffers right
  - <<C-W>d>: Duplicate window into new tab
  - <<C-W>e>: Equalize windows
  - <<C-W><Up>>: Swap buffers up
  - <<C-W>M>: Maximize height
  - <<C-W>a>: Toggle autowidth windows
  - <<C-W><Down>>: Swap buffers down
  - <<C-W>u>: Unsplit window
  - <<C-W>[>: Toggle collapse left windows
  - <<C-W><Left>>: Swap buffers left
  - <<C-W>]>: Toggle collapse right windows
  - <<C-W>W>: WinShift
  - <<C-W>t>: Break out into a new tab
  - <<C-W>m>: Maximize current window
  - <<C-W>n>: Create new tab
  - <<C-W>R>: Enter resize mode
  - <<C-W>P>: Move buffer to previous tab
- WARNING In mode `x`, <@> overlaps with <@(targets)>:
  - <@>: :help |v_@-default|
- WARNING In mode `x`, <i> overlaps with <iv>, <iN>, <iq>, <i_>, <im>, <ii>, <io>, <ig>, <iz>, <iS>, <i%>, <ik>:
  - <i>: inside
  - <iv>: inner value textobj
  - <iN>: inner notebookCell textobj
  - <iq>: inner anyQuote textobj
  - <i_>: inner lineCharacterwise textobj
  - <im>: inner chainMember textobj
  - <ii>: inner indentation
  - <io>: inner anyBracket textobj
  - <ig>: inner greedyOuterIndentation textobj
  - <iz>: inner closedFold textobj
  - <iS>: inner subword textobj
  - <ik>: inner key textobj
- WARNING In mode `x`, <a> overlaps with <av>, <aN>, <aq>, <a_>, <am>, <ai>, <ao>, <ag>, <az>, <aS>, <a%>, <ak>:
  - <a>: around
  - <av>: outer value textobj
  - <aN>: outer notebookCell textobj
  - <aq>: outer anyQuote textobj
  - <a_>: outer lineCharacterwise textobj
  - <am>: outer chainMember textobj
  - <ai>: outer indentation
  - <ao>: outer anyBracket textobj
  - <ag>: outer greedyOuterIndentation textobj
  - <az>: outer closedFold textobj
  - <aS>: outer subword textobj
  - <ak>: outer key textobj
- WARNING In mode `x`, <;D> overlaps with <;D<M-8>>, <;D<M-2>>, <;D<M-1>>, <;D<M-0>>, <;D<M-9>>, <;D<C-C><C-C>X>, <;D<C-C><C-C>p>, <;D<C-C><C-C>f>, <;D<C-C><C-C>q>, <;D<C-C><C-C>g>, <;D<C-C><C-C>c>, <;D<C-C><C-C>x>, <;D<C-C><C-L>>, <;D<M-7>>, <;D<M-6>>, <;D<M-5>>, <;D<M-4>>, <;D<M-3>>:
  - <;D>: Breakpoint toggle
  - <;D<M-8>>: Close
  - <;D<M-2>>: Continue
  - <;D<M-1>>: Breakpoint toggle
  - <;D<M-0>>: Toggle repl
  - <;D<M-9>>: Restart
  - <;D<C-C><C-C>X>: Breakpoints clear
  - <;D<C-C><C-C>p>: Pause
  - <;D<C-C><C-C>f>: Dap local config
  - <;D<C-C><C-C>q>: UI close
  - <;D<C-C><C-C>g>: Get session
  - <;D<C-C><C-C>c>: Run to cursor
  - <;D<C-C><C-C>x>: Disconnect
  - <;D<C-C><C-L>>: Lua dap launch
  - <;D<M-7>>: Down
  - <;D<M-6>>: Up
  - <;D<M-5>>: Step out
  - <;D<M-4>>: Step over
  - <;D<M-3>>: Step into
- WARNING In mode `s`, <;D> overlaps with <;D<M-8>>, <;D<M-2>>, <;D<M-1>>, <;D<M-0>>, <;D<M-9>>, <;D<C-C><C-C>X>, <;D<C-C><C-C>p>, <;D<C-C><C-C>f>, <;D<C-C><C-C>q>, <;D<C-C><C-C>g>, <;D<C-C><C-C>c>, <;D<C-C><C-C>x>, <;D<C-C><C-L>>, <;D<M-7>>, <;D<M-6>>, <;D<M-5>>, <;D<M-4>>, <;D<M-3>>:
  - <;D>: Breakpoint toggle
  - <;D<M-8>>: Close
  - <;D<M-2>>: Continue
  - <;D<M-1>>: Breakpoint toggle
  - <;D<M-0>>: Toggle repl
  - <;D<M-9>>: Restart
  - <;D<C-C><C-C>X>: Breakpoints clear
  - <;D<C-C><C-C>p>: Pause
  - <;D<C-C><C-C>f>: Dap local config
  - <;D<C-C><C-C>q>: UI close
  - <;D<C-C><C-C>g>: Get session
  - <;D<C-C><C-C>c>: Run to cursor
  - <;D<C-C><C-C>x>: Disconnect
  - <;D<C-C><C-L>>: Lua dap launch
  - <;D<M-7>>: Down
  - <;D<M-6>>: Up
  - <;D<M-5>>: Step out
  - <;D<M-4>>: Step over
  - <;D<M-3>>: Step into
- WARNING In mode `o`, <i> overlaps with <iv>, <iN>, <iq>, <i_>, <im>, <ii>, <io>, <ig>, <iz>, <iS>, <i%>, <ik>:
  - <i>: inside
  - <iv>: inner value textobj
  - <iN>: inner notebookCell textobj
  - <iq>: inner anyQuote textobj
  - <i_>: inner lineCharacterwise textobj
  - <im>: inner chainMember textobj
  - <ii>: inner indentation
  - <io>: inner anyBracket textobj
  - <ig>: inner greedyOuterIndentation textobj
  - <iz>: inner closedFold textobj
  - <iS>: inner subword textobj
  - <ik>: inner key textobj
- WARNING In mode `o`, <a> overlaps with <av>, <aN>, <aq>, <a_>, <am>, <ai>, <ao>, <ag>, <az>, <aS>, <a%>, <ak>:
  - <a>: around
  - <av>: outer value textobj
  - <aN>: outer notebookCell textobj
  - <aq>: outer anyQuote textobj
  - <a_>: outer lineCharacterwise textobj
  - <am>: outer chainMember textobj
  - <ai>: outer indentation
  - <ao>: outer anyBracket textobj
  - <ag>: outer greedyOuterIndentation textobj
  - <az>: outer closedFold textobj
  - <aS>: outer subword textobj
  - <ak>: outer key textobj
- WARNING In mode `n`, <yS> overlaps with <ySS>:
  - <yS>: Add a surrounding pair around a motion, on new lines (normal mode)
  - <ySS>: Add a surrounding pair around the current line, on new lines (normal mode)
- WARNING In mode `n`, <ys> overlaps with <yss>:
  - <ys>: Add a surrounding pair around a motion (normal mode)
  - <yss>: Add a surrounding pair around the current line (normal mode)
- 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 <;D<C-c><C-c>f> in mode `x`:
  * Dap local config: `{ nowait = true, remap = false, rhs = "<Cmd>DAPLocal<CR>", silent = true }`
  * Dap local config: `{ nowait = true, remap = false, rhs = "<Cmd>DAPLocal<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-l>> in mode `x`:
  * Lua dap launch: `{ nowait = true, remap = false, rhs = "<Cmd>LuaDapLaunch<CR>", silent = true }`
  * Lua dap launch: `{ nowait = true, remap = false, rhs = "<Cmd>LuaDapLaunch<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-c>X> in mode `x`:
  * Breakpoints clear: `{ nowait = true, remap = false, rhs = "<Cmd>DapClearBreakpoints<CR>", silent = true }`
  * Breakpoints clear: `{ nowait = true, remap = false, rhs = "<Cmd>DapClearBreakpoints<CR>", silent = true }`
- WARNING Duplicates for <<D-v>> in mode `s`:
  * Paste from clipboard: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Paste from clipboard: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<D-q>> in mode `s`:
  * Exit: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Exit: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<D-w>> in mode `s`:
  * Close window: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Close window: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<D-t>> in mode `s`:
  * New tabgroup: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').new_tabgroup()<Cr>", silent = true }`
  * New tabgroup: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').new_tabgroup()<Cr>", silent = true }`
- WARNING Duplicates for <<D-[>> in mode `s`:
  * Previous tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_previous_tabgroup()<Cr>", silent = true }`
  * Previous tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_previous_tabgroup()<Cr>", silent = true }`
- WARNING Duplicates for <<D-]>> in mode `s`:
  * Next tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_next_tabgroup()<Cr>", silent = true }`
  * Next tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_next_tabgroup()<Cr>", silent = true }`
- WARNING Duplicates for <<leader>rOl> in mode `n`:
  * Run last command - Flow: `{ nowait = true, remap = false, rhs = "<Cmd>FlowRunLastCmd<Cr>", silent = true }`
  * SnipLive: `{ nowait = true, remap = false, rhs = "<Cmd>SnipLive<Cr>", silent = true }`
- WARNING Duplicates for <<leader>xT> in mode `n`:
  * Run Current Test Class: `{ nowait = true, remap = false, rhs = "<cmd>XcodebuildTestClass<cr>", silent = true }`
  * Run Selected Tests: `{ nowait = true, remap = false, rhs = "<cmd>XcodebuildTestSelected<cr>", silent = true }`
- WARNING Duplicates for <<leader><leader>> in mode `n`:
  * Telescope buffers: `{ nowait = true, remap = false, rhs = "<cmd>Telescope buffers<cr>", silent = true }`
  * Telescope buffers: `{ nowait = true, remap = false, rhs = "<cmd>Telescope buffers<cr>", silent = true }`
- WARNING Duplicates for <<leader>dp> in mode `n`:
  * Print variable: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Print variable: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <g> in mode `n`:
  * [G]o: `{ group = true, icon = "󰎐", nowait = true, remap = false, silent = true }`
  * [G]o: `{ group = true, icon = "󰎐", nowait = true, remap = false, silent = true }`
- WARNING Duplicates for <<C-S-h>> in mode `n`:
  * Resize window right: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Resize window left: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<C-S-h>> in mode `t`:
  * Resize window right: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Resize window left: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<C-S-h>> in mode `i`:
  * Resize window right: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Resize window left: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<leader>rOr> in mode `v`:
  * SnipRun: `{ nowait = true, remap = false, rhs = "<Plug>SnipRun", silent = true }`
  * Run selected code (flow): `{ nowait = true, remap = false, rhs = "<Cmd>FlowRunSelected<CR>", silent = true }`
- WARNING Duplicates for <g> in mode `x`:
  * [G]o: `{ group = true, icon = "󰎐", nowait = true, remap = false, silent = true }`
  * [G]o: `{ group = true, icon = "󰎐", nowait = true, remap = false, silent = true }`
- WARNING Duplicates for <<leader>cc> in mode `x`:
  * Change text case: `{ nowait = true, remap = false, rhs = "<Cmd>TextCaseOpenTelescope<Cr>", silent = true }`
  * Change text case: `{ nowait = true, remap = false, rhs = "<Cmd>TextCaseOpenTelescope<Cr>", silent = true }`
- WARNING Duplicates for <g> in mode `v`:
  * [G]o: `{ group = true, icon = "󰎐", nowait = true, remap = false, silent = true }`
  * [G]o: `{ group = true, icon = "󰎐", nowait = true, remap = false, silent = true }`
- WARNING Duplicates for <<D-v>> in mode `x`:
  * Paste from clipboard: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Paste from clipboard: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<D-q>> in mode `x`:
  * Exit: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Exit: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<D-w>> in mode `x`:
  * Close window: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Close window: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <<D-t>> in mode `x`:
  * New tabgroup: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').new_tabgroup()<Cr>", silent = true }`
  * New tabgroup: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').new_tabgroup()<Cr>", silent = true }`
- WARNING Duplicates for <<D-[>> in mode `x`:
  * Previous tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_previous_tabgroup()<Cr>", silent = true }`
  * Previous tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_previous_tabgroup()<Cr>", silent = true }`
- WARNING Duplicates for <<D-]>> in mode `x`:
  * Next tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_next_tabgroup()<Cr>", silent = true }`
  * Next tab: `{ nowait = true, remap = false, rhs = "<Cmd>lua require('utils.general').select_next_tabgroup()<Cr>", silent = true }`
- WARNING Duplicates for <;D> in mode `v`:
  * Breakpoint toggle: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
  * Breakpoint toggle: `{ nowait = true, remap = false, rhs = <function 1>, silent = true }`
- WARNING Duplicates for <;D<M-1>> in mode `v`:
  * Breakpoint toggle: `{ nowait = true, remap = false, rhs = "<Cmd>DapToggleBreakpoint<CR>", silent = true }`
  * Breakpoint toggle: `{ nowait = true, remap = false, rhs = "<Cmd>DapToggleBreakpoint<CR>", silent = true }`
- WARNING Duplicates for <;D<M-2>> in mode `v`:
  * Continue: `{ nowait = true, remap = false, rhs = "<Cmd>DapContinue<CR>", silent = true }`
  * Continue: `{ nowait = true, remap = false, rhs = "<Cmd>DapContinue<CR>", silent = true }`
- WARNING Duplicates for <;D<M-3>> in mode `v`:
  * Step into: `{ nowait = true, remap = false, rhs = "<Cmd>DapStepInto<CR>", silent = true }`
  * Step into: `{ nowait = true, remap = false, rhs = "<Cmd>DapStepInto<CR>", silent = true }`
- WARNING Duplicates for <;D<M-4>> in mode `v`:
  * Step over: `{ nowait = true, remap = false, rhs = "<Cmd>DapStepOver<CR>", silent = true }`
  * Step over: `{ nowait = true, remap = false, rhs = "<Cmd>DapStepOver<CR>", silent = true }`
- WARNING Duplicates for <;D<M-5>> in mode `v`:
  * Step out: `{ nowait = true, remap = false, rhs = "<Cmd>DapStepOut<CR>", silent = true }`
  * Step out: `{ nowait = true, remap = false, rhs = "<Cmd>DapStepOut<CR>", silent = true }`
- WARNING Duplicates for <;D<M-6>> in mode `v`:
  * Up: `{ nowait = true, remap = false, rhs = "<Cmd>DapUp<CR>", silent = true }`
  * Up: `{ nowait = true, remap = false, rhs = "<Cmd>DapUp<CR>", silent = true }`
- WARNING Duplicates for <;D<M-7>> in mode `v`:
  * Down: `{ nowait = true, remap = false, rhs = "<Cmd>DapDown<CR>", silent = true }`
  * Down: `{ nowait = true, remap = false, rhs = "<Cmd>DapDown<CR>", silent = true }`
- WARNING Duplicates for <;D<M-8>> in mode `v`:
  * Close: `{ nowait = true, remap = false, rhs = "<Cmd>DapClose<CR><Cmd>DapDisconnect<CR><Cmd>DapUIClose<CR>", silent = true }`
  * Close: `{ nowait = true, remap = false, rhs = "<Cmd>DapClose<CR><Cmd>DapDisconnect<CR><Cmd>DapUIClose<CR>", silent = true }`
- WARNING Duplicates for <;D<M-9>> in mode `x`:
  * Restart: `{ nowait = true, remap = false, rhs = "<Cmd>DapRestart<CR>", silent = true }`
  * Restart: `{ nowait = true, remap = false, rhs = "<Cmd>DapRestart<CR>", silent = true }`
- WARNING Duplicates for <;D<M-0>> in mode `x`:
  * Toggle repl: `{ nowait = true, remap = false, rhs = "<Cmd>DapToggleRepl<CR>", silent = true }`
  * Toggle repl: `{ nowait = true, remap = false, rhs = "<Cmd>DapToggleRepl<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-c>c> in mode `x`:
  * Run to cursor: `{ nowait = true, remap = false, rhs = "<Cmd>DapRunToCursor<CR>", silent = true }`
  * Run to cursor: `{ nowait = true, remap = false, rhs = "<Cmd>DapRunToCursor<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-c>p> in mode `x`:
  * Pause: `{ nowait = true, remap = false, rhs = "<Cmd>DapPause<CR>", silent = true }`
  * Pause: `{ nowait = true, remap = false, rhs = "<Cmd>DapPause<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-c>x> in mode `x`:
  * Disconnect: `{ nowait = true, remap = false, rhs = "<Cmd>DapDisconnect<CR>", silent = true }`
  * Disconnect: `{ nowait = true, remap = false, rhs = "<Cmd>DapDisconnect<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-c>g> in mode `x`:
  * Get session: `{ nowait = true, remap = false, rhs = "<Cmd>DapGetSession<CR>", silent = true }`
  * Get session: `{ nowait = true, remap = false, rhs = "<Cmd>DapGetSession<CR>", silent = true }`
- WARNING Duplicates for <;D<C-c><C-c>q> in mode `x`:
  * UI close: `{ nowait = true, remap = false, rhs = "<Cmd>DapUIClose<CR>", silent = true }`
  * UI close: `{ nowait = true, remap = false, rhs = "<Cmd>DapUIClose<CR>", silent = true }`
- OK Duplicate mappings are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Log

Debug Started for v3.13.2
{
  branch = "main",
  commit = "6c1584eb76b55629702716995cca4ae2798a9cca"
}
new Mode(n:1)
BufNew(5)
BufEnter(5)
  new Mode(n:5)
BufNew(6)
BufEnter(6)
  new Mode(n:6)
BufEnter(6)
on_key: <Space>pl
BufNew(9)
BufNew(10)
BufNew(11)
BufNew(12)
BufNew(13)
BufNew(14)
BufNew(15)
BufNew(16)
BufNew(17)
BufNew(18)
BufNew(19)
BufEnter(19)
  new Mode(n:19)
BufNew(20)
BufEnter(20)
  new Mode(n:20)
BufEnter(5)
BufReadPost(15)
BufEnter(15)
  new Mode(n:15)
BufEnter(19)
BufReadPost(16)
BufEnter(16)
  new Mode(n:16)
BufReadPost(17)
BufEnter(17)
  new Mode(n:17)
BufEnter(16)
BufEnter(20)
BufEnter(16)
Trigger(add) Mode(n:1) ' ` " g' g` Z ] [ z ; = <Plug> <C-W> g <Space> \
Trigger(add) Mode(n:17) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
Trigger(add) Mode(n:16) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
Trigger(add) Mode(n:15) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
Trigger(add) Mode(n:20) ' ` " g' g` Z ] [ z <Space> ; = <Plug> <C-W> g \
BufNew(28)
BufNew(29)
BufNew(30)
BufNew(31)
BufNew(32)
BufEnter(32)
  new Mode(n:32)
BufEnter(32)
Trigger(add) Mode(n:32) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
LspAttach(17)
  Trigger(del) Mode(n:17) g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g ' ` "
LspAttach(16)
  Trigger(del) Mode(n:16) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
LspAttach(15)
  Trigger(del) Mode(n:15) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
BufNew(35)
BufNew(36)
on_key: <C-,>
BufNew(37)
BufEnter(37)
  new Mode(n:37)
Trigger(add) Mode(n:37) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
on_key: <C-;>
on_key: <C-L>
BufEnter(16)
  new Mode(n:16)
Trigger(add) Mode(n:16) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
on_key: <LeftRelease>
on_key: ;
State(start): Mode(n:0) Node(;) { keys = ";" }
  update Mode(n:16)
  continue: ; Mode(n:16)
  getchar
  on_key: D
  got: D
  suspend: Mode(n:16)
  Trigger(del) Mode(n:16) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g
  feedkeys: Mode(n:16) ;D
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  suspend: Mode(n:16)
  feedkeys: Mode(n:16) ;D
  executed
on_key: ;D
State(start): Mode(n:0) Node(;D) { delay = 0, keys = ";D", loop = true, waited = 1000 }
  update Mode(n:16)
  BufNew(40)
  recursion detected. Aborting
BufNew(41)
on_key: <C-H>
BufEnter(37)
Trigger(add) Mode(n:16) ' ` " g' g` Z ] [ z <Space> \ ; <Plug> <C-W> g

Repro

wk.add({
    {
      mode = { "n", "x", "v" },
      buffer = nil,
      silent = true,
      noremap = true,
      nowait = true,
      {
        ";D",
        function()
          require("which-key").show({
            keys = ";D",
            loop = true, -- this will keep the popup open until you hit <esc>
          })
        end,
        desc = "Breakpoint toggle",
      },
      { ";D<M-1>", "<Cmd>DapToggleBreakpoint<CR>", desc = "Breakpoint toggle" },
      { ";D<M-2>", "<Cmd>DapContinue<CR>", desc = "Continue" },
      { ";D<M-3>", "<Cmd>DapStepInto<CR>", desc = "Step into" },
      { ";D<M-4>", "<Cmd>DapStepOver<CR>", desc = "Step over" },
      { ";D<M-5>", "<Cmd>DapStepOut<CR>", desc = "Step out" },
      { ";D<M-6>", "<Cmd>DapUp<CR>", desc = "Up" },
      { ";D<M-7>", "<Cmd>DapDown<CR>", desc = "Down" },
      { ";D<M-8>", "<Cmd>DapClose<CR><Cmd>DapDisconnect<CR><Cmd>DapUIClose<CR>", desc = "Close" },
      { ";D<M-9>", "<Cmd>DapRestart<CR>", desc = "Restart" },
      { ";D<M-0>", "<Cmd>DapToggleRepl<CR>", desc = "Toggle repl" },
      { ";D<C-c><C-c>c", "<Cmd>DapRunToCursor<CR>", desc = "Run to cursor" },
      { ";D<C-c><C-c>p", "<Cmd>DapPause<CR>", desc = "Pause" },
      { ";D<C-c><C-c>x", "<Cmd>DapDisconnect<CR>", desc = "Disconnect" },
      { ";D<C-c><C-c>g", "<Cmd>DapGetSession<CR>", desc = "Get session" },
      { ";D<C-c><C-c>q", "<Cmd>DapUIClose<CR>", desc = "UI close" },
      { ";D<C-c><C-c>f", "<Cmd>DAPLocal<CR>", desc = "Dap local config" },
      { ";D<C-c><C-l>", "<Cmd>LuaDapLaunch<CR>", desc = "Lua dap launch" },
      { ";D<C-c><C-c>X", "<Cmd>DapClearBreakpoints<CR>", desc = "Breakpoints clear" },
    },
  })
max397574 commented 1 month ago

I think the problem here is that you map ;D to show which key for ;D similar to this issue https://github.com/folke/which-key.nvim/issues/714 I would

  1. try to map a different key to this to see if this is really the problem here
  2. try to remove the nowait because that might cause problems here because ;D will instantly execute the mapping and the mapping maps to show which key again -> recursion

perhaps this is somehow doable with the triggers option even though it seems like you can't add the loop thing there but that option should normally be used to accomplish what you want here (well actually if it weren't for the loop option this would require no additional setup)

Ajaymamtora commented 1 month ago

I think the problem here is that you map ;D to show which key for ;D similar to this issue #714 I would

  1. try to map a different key to this to see if this is really the problem here
  2. try to remove the nowait because that might cause problems here because ;D will instantly execute the mapping and the mapping maps to show which key again -> recursion

perhaps this is somehow doable with the triggers option even though it seems like you can't add the loop thing there but that option should normally be used to accomplish what you want here (well actually if it weren't for the loop option this would require no additional setup)

Okay just setting no wait to false stops the infinite loop, but some of those mappings cause hydra to close, I've gone back to nvimtools/hydra instead for now, feel free to close

max397574 commented 1 month ago

In my opinion this should stay open because it isn't clear how this should be done correctly I'd assume it is how you've done it (without the nowait) but then this is a bug when the menu is closed sometimes

mintelm commented 1 month ago

Yeah, I'm also interested in this feature. I also tried to use the loop feature, however, I had the same issues and also went back to nvimtools/hydra, but I'd prefer to use which-key.nvim if it can simulate the behavior of hydra.

github-actions[bot] commented 1 day ago

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.

Ajaymamtora commented 1 day ago

.