Skip to content

Commit

Permalink
grepper#complete_files: check for whitespace at end of head
Browse files Browse the repository at this point in the history
It seems like this just confused path with head for completing relative
files.  With "foo " head contains whitespace at the end, but path does
not.

This fixes completion of relative files basically.
  • Loading branch information
blueyed committed Mar 1, 2018
1 parent 58a808c commit 8b872e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/grepper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ endfunction
" grepper#complete_files() {{{2
function! grepper#complete_files(lead, _line, _pos)
let [head, path] = s:extract_path(a:lead)
" handle relative paths
if empty(path) || (path =~ '\s$')
" handle initial relative paths
if empty(path) && head =~# '\s$'
return map(split(globpath('.'.s:slash, path.'*'), '\n'), 'head . "." . v:val[1:] . (isdirectory(v:val) ? s:slash : "")')
" handle sub paths
elseif path =~ '^.\/'
Expand Down

0 comments on commit 8b872e3

Please sign in to comment.