hecal3 / vim-leader-guide

295 stars 21 forks source link

Error message shown on pressing Space (dictionary required / list required) #13

Closed lverweijen closed 8 years ago

lverweijen commented 8 years ago

The plugin works, but displays this error before displaying the mappings:

Error detected while processing function leaderGuide#start_by_prefix[9]..12_start_parser[23 ]..12_add_map_to_dict[23]..12_add_map_to_dict[32]..12_flattenmap[9]..12_flat tenmap: line 2: E715: Dictionary required E714: List required Error detected while processing function leaderGuide#start_by_prefix[9]..12_start_parser[23 ]..12_add_map_to_dict[23]..12_add_map_to_dict[32]..12_flattenmap[9]..12_flat tenmap[9]..12_flattenmap: line 2: E715: Dictionary required E714: List required Error detected while processing function leaderGuide#start_by_prefix[9]..12_start_parser[23 ]..12_add_map_to_dict[23]..12_add_map_to_dict[32]..12_flattenmap[9]..12_flat tenmap[9]..12_flattenmap[9]..12_flattenmap: line 2: E715: Dictionary required E714: List required

Here a minimal configuration: let mapleader=" " let g:llmap = {} call leaderGuide#register_prefix_descriptions("", "g:llmap") call unite#filters#matcher_default#use(['matcher_fuzzy']) nnoremap :LeaderGuide '' vnoremap :LeaderGuideVisual '' nnoremap abc :dosomething

hecal3 commented 8 years ago

I think your configuration example got messed up by github. Maybe you could enclose it with a `````vim block, or just paste it somewhere else.

lverweijen commented 8 years ago

It seems that the align-plugin is also a neccesity for this error to work.

I have made an extremely self-contained example here.

Run it by:

vim -u leadervimbug.vim
hecal3 commented 8 years ago

Thanks, from what I can tell this is another one of those conflict issues. The align-plugin defines:

map <unique> <Leader>aunum <Plug>AM_aunum

This somewhat conflicts with your mapping

nnoremap <Leader>au :dosomething<CR>

It's not possible to display those two in a strictly hierarchical manner.

If you don't set let g:leaderGuide_flatten = 0 those two mappings should be displayed side by side in the <leader>a-menu. Apparently this does not work here. If I had to guess I'd say its because the difference in length between the mappings is greater than 1. A bug in any case. I'll take a closer look later.

edit: Nice minimal example btw.

hecal3 commented 8 years ago

Should be fixed with the latest commit. I forgot to handle the "name" attribute in the dictionaries. And it indeed only showed when the difference between the mapping length was >1.

Edit: That being said, the default mappings of Align are really hard to display in a readable manner. They are basically commands disguised as mappings. ;)