Skip to content

Commit bdbdb4d

Browse files
committed
Merge pull request tpope#105 from tandrewnichols/patch-1
Help projectionist find .projections.json in new directories * github.com:tpope/vim-projectionist: Help projectionist find .projections.json in new directories
2 parents 17a8b20 + f672525 commit bdbdb4d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

plugin/projectionist.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ function! s:has(ns, root, requirements) abort
6969
endfunction
7070

7171
function! ProjectionistDetect(path) abort
72+
let path = a:path
73+
if path !~ '^/'
74+
let path = getcwd() . '/' . path
75+
endif
76+
7277
let b:projectionist = {}
7378
unlet! b:projectionist_file
74-
if a:path =~# '^\a[[:alnum:].+-]\+:'
75-
let file = substitute(a:path, '[\/]$', '', '')
76-
else
77-
let file = simplify(fnamemodify(resolve(a:path), ':p:s?[\/]$??'))
78-
endif
79+
let file = simplify(fnamemodify(path, ':p:s?[\/]$??'))
7980

8081
let root = file
8182
let ns = matchstr(file, '^\a\a\+\ze:')

0 commit comments

Comments
 (0)