gelguy / Cmd2.vim

cmdline-mode enhancement for Vim
MIT License
94 stars 4 forks source link

Error when completing without inputting any characters. #12

Closed rgrinberg closed 8 years ago

rgrinberg commented 8 years ago

Here's the error:

Error detected while processing function Cmd2#main#Run..122..278..112..124..142..Cmd2#ext#suggest#GetCandidates:
line   23:
E684: list index out of range: -1
E116: Invalid arguments for function len(tokens[-1]) < g:Cmd2__suggest_min_length) && !a:force_menu
E15: Invalid expression: (len(tokens[-1]) < g:Cmd2__suggest_min_length) && !a:force_menu
let g:Cmd2_cmd_mappings = {
      \ 'iw': {'command': 'iw', 'type': 'text', 'flags': 'Cpv'},
      \ 'ap': {'command': 'ap', 'type': 'line', 'flags': 'pv'},
      \ '^': {'command': '^', 'type': 'normal!', 'flags': 'r'},
      \ 'w': {'command': 'Cmd2#functions#Cword',
      \ 'type': 'function', 'flags': 'Cr'},
      \ }
let g:Cmd2_options = {
      \ '_complete_ignorecase': 1,
      \ '_complete_uniq_ignorecase': 0,
      \ '_quicksearch_ignorecase': 1,
      \ '_complete_start_pattern': '\<\(\k\+\(_\|\#\)\)\?',
      \ '_complete_fuzzy': 1,
      \ }
cmap <leader><leader> <Plug>Cmd2
nmap : :<F12>
cmap <F12> <Plug>(Cmd2Suggest)
cmap <expr> <Tab> Cmd2#ext#complete#InContext() ? "\<Plug>(Cmd2Complete)" : "\<Tab>"
set wildcharm=<Tab>

To reproduce error: :<tab>

I'm also using neovim if it matters.

gelguy commented 8 years ago

Thanks for the report!

This should be fixed in 98b26d28cacf97106d90ca7ad18bbbdad928c701.