Skip to content

Commit

Permalink
fixup! complete_files: more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Dec 21, 2018
1 parent 664e41a commit 5c3316c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin/grepper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,16 @@ function! grepper#complete_files(lead, _line, _pos)
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[home_len:] . (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 : '''')')
return map(split(globpath('.'.s:slash, path[2:].'*'), '\n'), "head . v:val . (isdirectory(v:val) ? s:slash : '')")
" handle absolute paths
elseif path[0] ==# '/'
return map(split(globpath(s:slash, path.'*'), '\n'), 'head . v:val[1:] . (isdirectory(v:val) ? s:slash : '''')')
return map(split(globpath(s:slash, path.'*'), '\n'), "head . v:val[1:] . (isdirectory(v:val) ? s:slash : '')")
" handle relative paths
else
return map(split(globpath('.'.s:slash, path.'*'), '\n'), 'head . ''.'' . v:val[1:] . (isdirectory(v:val) ? s:slash : "")')
return map(split(globpath('.'.s:slash, path.'*'), '\n'), "head . '.' . v:val[1:] . (isdirectory(v:val) ? s:slash : '')")
endif
endfunction

Expand Down

0 comments on commit 5c3316c

Please sign in to comment.