which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

Need help with checkhealth output

Open syntaxman opened this issue 3 years ago • 4 comments

I get the following output from "checkhealth which_key":

which_key: health#which_key#check
========================================================================
## WhichKey: checking conflicting keymaps
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"**
  - INFO: rhs: `<Plug>kommentary_motion_default`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **" cd"**
  - INFO: rhs: `<Plug>kommentary_motion_decrease`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **" ci"**
  - INFO: rhs: `<Plug>kommentary_motion_increase`

I have seen in another "Issues" entry that a user got information for "old rhs" and also for "new rhs". I'm not getting that. I can't tell what is conflicting from what I see here. I didn't directly set these keymaps, so I can't just grep my config files. How can I track this down, please?

syntaxman avatar Dec 19 '21 23:12 syntaxman

i have same issue, but i think this is answer for your question @syntaxman https://giters.com/folke/which-key.nvim/issues/95

shendypratamaa avatar Dec 31 '21 07:12 shendypratamaa

Also am bit confused about that output

which_key: health#which_key#check
========================================================================
## WhichKey: checking conflicting keymaps
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gb"**
  - INFO: rhs: `<Plug>(comment_toggle_blockwise)`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"**
  - INFO: rhs: `<Plug>(comment_toggle_linewise)`

I got that those are just a warnings. But i would like to see clean log.

dzintars avatar Jun 03 '22 20:06 dzintars

For reference, the issue with comment.nvim is related to the below:

---LHS of toggle mappings in NORMAL mode
toggler = {
    ---Line-comment toggle keymap
    line = 'gcc',
    ---Block-comment toggle keymap
    block = 'gbc',
},
---LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
    ---Line-comment keymap
    line = 'gc',
    ---Block-comment keymap
    block = 'gb',
},

The above works fine even though there ar "conflicting keys", but I think it makes sense for which-key to complain as it can only display one command name per mapping.

agoodshort avatar Jan 15 '23 23:01 agoodshort

waring is still there, not sure why?

cxwx avatar Sep 02 '23 04:09 cxwx

I can verify that this conflict occurs in https://github.com/numToStr/Comment.nvim/blob/0236521ea582747b58869cb72f70ccfa967d2e89/lua/Comment/init.lua#L100-L110.

If I understand the following code correctly, gc and gcc conflict with each other.

 K('n', 'gc', '<Plug>(comment_toggle_linewise)', { desc = 'Comment toggle linewise' })
 K('n', 'gcc', function() 
     return vvar('count') == 0 and '<Plug>(comment_toggle_linewise_current)' 
         or '<Plug>(comment_toggle_linewise_count)' 
 end, { expr = true, desc = 'Comment toggle current line' }) 

This is why we need to set the timeoutlen in the https://github.com/numToStr/Comment.nvim/issues/115#issuecomment-1032290098.

Relate issue: https://github.com/numToStr/Comment.nvim/issues/364.

DianQK avatar Jan 14 '24 06:01 DianQK