mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Support Projectionist config in .git/info/projections.json
This commit is contained in:
@@ -212,6 +212,18 @@ function! s:Slash(path) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:ProjectionistDetect() abort
|
||||||
|
let file = s:Slash(get(g:, 'projectionist_file', ''))
|
||||||
|
let dir = FugitiveExtractGitDir(file)
|
||||||
|
let base = matchstr(file, '^fugitive://.\{-\}//\x\+')
|
||||||
|
if empty(base)
|
||||||
|
let base = FugitiveTreeForGitDir(dir)
|
||||||
|
endif
|
||||||
|
if len(base)
|
||||||
|
call projectionist#append(base, FugitiveCommonDir(dir) . '/info/projections.json')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
augroup fugitive
|
augroup fugitive
|
||||||
autocmd!
|
autocmd!
|
||||||
|
|
||||||
@@ -258,4 +270,6 @@ augroup fugitive
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
autocmd User Flags call Hoist('buffer', function('FugitiveStatusline'))
|
autocmd User Flags call Hoist('buffer', function('FugitiveStatusline'))
|
||||||
|
|
||||||
|
autocmd User ProjectionistDetect call s:ProjectionistDetect()
|
||||||
augroup END
|
augroup END
|
||||||
|
|||||||
Reference in New Issue
Block a user