Skip to content

Commit

Permalink
Remove file/path completion for Grepper command
Browse files Browse the repository at this point in the history
As far as I can tell, this does not make sense for the Grepper command.
The command opens the prompt, from which path completion is performed.

I suspect the right thing to do here is complete with all flags, but it
seems sensible to leave that for another commit to make changes clear.
  • Loading branch information
mmrwoods committed May 6, 2022
1 parent f5a2357 commit 50ce9b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/grepper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/feature/completion.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 50ce9b9

Please sign in to comment.