Skip to content

Commit bd1de1e

Browse files
committed
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.
1 parent 46d78f2 commit bd1de1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/grepper.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ endfunction
236236
" grepper#complete_files() {{{2
237237
function! grepper#complete_files(lead, _line, _pos)
238238
let [head, path] = s:extract_path(a:lead)
239-
" handle relative paths
240-
if empty(path) || (path =~ '\s$')
239+
" handle initial relative paths
240+
if empty(path) && head =~# '\s$'
241241
return map(split(globpath('.'.s:slash, path.'*'), '\n'), 'head . "." . v:val[1:] . (isdirectory(v:val) ? s:slash : "")')
242242
" handle sub paths
243243
elseif path =~ '^.\/'

0 commit comments

Comments
 (0)