From 8b872e3d4ce8728071c7abe5adb2e1621e7096b0 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 1 Mar 2018 00:53:59 +0100 Subject: [PATCH] grepper#complete_files: check for whitespace at end of head 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. --- plugin/grepper.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/grepper.vim b/plugin/grepper.vim index 4b4a395..84927f1 100644 --- a/plugin/grepper.vim +++ b/plugin/grepper.vim @@ -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 =~ '^.\/'