mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-06 12:14:26 +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'
|
||||
endif
|
||||
|
||||
function! s:config() abort
|
||||
function! s:Config() abort
|
||||
if exists('*FugitiveCommonDir')
|
||||
let dir = FugitiveCommonDir()
|
||||
elseif exists('*FugitiveRoute')
|
||||
let dir = FugitiveRoute('.git/config')[0:-8]
|
||||
else
|
||||
let dir = get(b:, 'git_dir', '')
|
||||
let common_dir = b:git_dir . '/commondir'
|
||||
@@ -34,7 +36,7 @@ augroup rhubarb
|
||||
\ if expand('%:p') =~# '\.git[\/].*MSG$' &&
|
||||
\ exists('+omnifunc') &&
|
||||
\ &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*'')))')) |
|
||||
\ setlocal omnifunc=rhubarb#omnifunc |
|
||||
\ endif
|
||||
|
||||
Reference in New Issue
Block a user