mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-06 20:24:29 +08:00
Leverage another API for getting common dir
This commit is contained in:
@@ -15,9 +15,11 @@ if get(g:, 'fugitive_git_command', 'git') ==# 'git' && executable('hub')
|
|||||||
let g:fugitive_git_command = 'hub'
|
let g:fugitive_git_command = 'hub'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:config() abort
|
function! s:Config() abort
|
||||||
if exists('*FugitiveCommonDir')
|
if exists('*FugitiveCommonDir')
|
||||||
let dir = FugitiveCommonDir()
|
let dir = FugitiveCommonDir()
|
||||||
|
elseif exists('*FugitiveRoute')
|
||||||
|
let dir = FugitiveRoute('.git/config')[0:-8]
|
||||||
else
|
else
|
||||||
let dir = get(b:, 'git_dir', '')
|
let dir = get(b:, 'git_dir', '')
|
||||||
let common_dir = b:git_dir . '/commondir'
|
let common_dir = b:git_dir . '/commondir'
|
||||||
@@ -34,7 +36,7 @@ augroup rhubarb
|
|||||||
\ if expand('%:p') =~# '\.git[\/].*MSG$' &&
|
\ if expand('%:p') =~# '\.git[\/].*MSG$' &&
|
||||||
\ exists('+omnifunc') &&
|
\ exists('+omnifunc') &&
|
||||||
\ &omnifunc =~# '^\%(syntaxcomplete#Complete\)\=$' &&
|
\ &omnifunc =~# '^\%(syntaxcomplete#Complete\)\=$' &&
|
||||||
\ !empty(filter(s:config(),
|
\ !empty(filter(s:Config(),
|
||||||
\ '!empty(rhubarb#homepage_for_url(matchstr(v:val, ''^\s*url\s*=\s*"\=\zs\S*'')))')) |
|
\ '!empty(rhubarb#homepage_for_url(matchstr(v:val, ''^\s*url\s*=\s*"\=\zs\S*'')))')) |
|
||||||
\ setlocal omnifunc=rhubarb#omnifunc |
|
\ setlocal omnifunc=rhubarb#omnifunc |
|
||||||
\ endif
|
\ endif
|
||||||
|
|||||||
Reference in New Issue
Block a user