From beaeb9fb62c8e84f9c515db2d54ac4781fe00339 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 14 Mar 2018 00:53:59 +0100 Subject: [PATCH] fixup! fixup! complete_files: more fixes --- plugin/grepper.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/grepper.vim b/plugin/grepper.vim index 2d3b63f..b9b45dc 100644 --- a/plugin/grepper.vim +++ b/plugin/grepper.vim @@ -235,8 +235,7 @@ function! grepper#complete_files(lead, _line, _pos) " handle paths in $HOME (~/foo) if path[0:1] ==# '~/' let home = expand('~') - let home_len = len(home) - return map(split(globpath(home, path[2:].'*'), '\n'), "head . '~' . v:val[home_len:] . (isdirectory(v:val) ? s:slash : '')") + return map(split(globpath(home, path[2:].'*'), '\n'), "head . '~' . v:val[".len(home).":] . (isdirectory(v:val) ? s:slash : '')") " handle (explicit) relative paths elseif path[0:1] ==# './' return map(split(globpath('.'.s:slash, path[2:].'*'), '\n'), "head . v:val . (isdirectory(v:val) ? s:slash : '')")