Skip to content

Commit f1b96e1

Browse files
committed
Revert "Handle sub-paths as relative paths when completing"
Although the tests for grepper#complete still pass after this change, when completing from the prompt, each completion after this adds another leading dot and slash, which suggests that maybe I need to testing grepper#complete_files directly (prompt uses grepper#complete_files). This reverts commit 5132e85.
1 parent 5132e85 commit f1b96e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugin/grepper.vim

+3
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ function! grepper#complete_files(lead, _line, _pos)
241241
" handle paths in $HOME (~/foo)
242242
elseif path[0:1] ==# '~/'
243243
return map(split(globpath($HOME, path[2:].'*'), '\n'), 'head . "~" . v:val['.len($HOME).':] . (isdirectory(v:val) ? s:slash : "")')
244+
" handle sub paths
245+
elseif path =~ '^.\/'
246+
return map(split(globpath('.'.s:slash, path[2:].'*'), '\n'), 'head . "." . v:val[1:] . (isdirectory(v:val) ? s:slash : "")')
244247
" handle absolute paths
245248
elseif path[0] == '/'
246249
return map(split(globpath(s:slash, path.'*'), '\n'), 'head . v:val[1:] . (isdirectory(v:val) ? s:slash : "")')

0 commit comments

Comments
 (0)