Skip to content

Commit 8b872e3

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 58a808c commit 8b872e3

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
@@ -235,8 +235,8 @@ endfunction
235235
" grepper#complete_files() {{{2
236236
function! grepper#complete_files(lead, _line, _pos)
237237
let [head, path] = s:extract_path(a:lead)
238-
" handle relative paths
239-
if empty(path) || (path =~ '\s$')
238+
" handle initial relative paths
239+
if empty(path) && head =~# '\s$'
240240
return map(split(globpath('.'.s:slash, path.'*'), '\n'), 'head . "." . v:val[1:] . (isdirectory(v:val) ? s:slash : "")')
241241
" handle sub paths
242242
elseif path =~ '^.\/'

0 commit comments

Comments
 (0)