diff --git a/plugin/grepper.vim b/plugin/grepper.vim index b72b8c5..199bbb7 100644 --- a/plugin/grepper.vim +++ b/plugin/grepper.vim @@ -228,7 +228,7 @@ function! grepper#complete(lead, line, _pos) abort return filter(map(sort(copy(g:grepper.tools)), 'v:val." "'), \ 'empty(a:lead) || v:val[:strlen(a:lead)-1] ==# a:lead') else - return grepper#complete_files(a:lead, 0, 0) + return [] endif endfunction diff --git a/test/feature/completion.vader b/test/feature/completion.vader index e1d6cbc..0295c9a 100644 --- a/test/feature/completion.vader +++ b/test/feature/completion.vader @@ -37,6 +37,9 @@ Execute (command: flags, -tool options): Assert len(grepper#complete('', 'Grepper -tool ', v:null)) > 1 AssertEqual count(grepper#complete('', 'Grepper -tool ', v:null), 'grep '), 1 +Execute (command: flags, default, no completion): + Assert len(grepper#complete('', '', v:null)) == 0 + Execute (prompt: path, tilde expansion): AssertEqual grepper#complete_files('x ~', v:null, v:null), ['x '.$HOME]