Skip to content

Commit ff37de5

Browse files
committed
Use relative directory.
1 parent 410e921 commit ff37de5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plugin/side-search.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,19 @@ endfunction
153153

154154
function! s:guessProjectRoot()
155155
let l:splitsearchdir = split(getcwd(), "/")
156+
let l:searchdir = ''
156157

157158
while len(l:splitsearchdir) > 2
158-
let l:searchdir = '/'.join(l:splitsearchdir, '/').'/'
159159
for l:marker in ['.rootdir', '.git', '.hg', '.svn', 'bzr', '_darcs', 'build.xml']
160+
let l:dir = l:searchdir.l:marker
160161
" found it! Return the dir
161-
if filereadable(l:searchdir.l:marker) || isdirectory(l:searchdir.l:marker)
162+
if filereadable(l:dir) || isdirectory(l:dir)
162163
return l:searchdir
163164
endif
164165
endfor
165-
let l:splitsearchdir = l:splitsearchdir[0:-2] " Splice the list to get rid of the tail directory
166+
" Splice the list to get rid of the tail directory
167+
let l:splitsearchdir = l:splitsearchdir[0:-2]
168+
let l:searchdir = '../'.l:searchdir
166169
endwhile
167170

168171
" Nothing found, fallback to current working dir

0 commit comments

Comments
 (0)