liuchengxu/vim-which-key

Separate dicts for each mode

james-w opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
The mappings dict is only specific to the key that is passed to register. This means
that the same mapping dict is used regardless of the mode, and that you can have
mappings in the dict that aren't in the mode, which leads to weird display like:

t → a     T → i     u → n     

rather than

t → tagbar                                T → find current file in nerdtree         u → undotree 

It also means that if the same key has different bindings in different modes you
can't put a separate description for each.

Describe the solution you'd like
One approach would be to also pass a mode when calling register.
Alternatively the dict could embed mode identifiers that could be used when
traversing it.

Describe alternatives you've considered
I can't think of any way to work around this.

Additional context
Using 4b70b44

I don't have time to look into this.