mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-07 04:34:27 +08:00
Add ssh://git@ to origin url base (#16)
This commit is contained in:
@@ -30,7 +30,7 @@ function! rhubarb#homepage_for_url(url) abort
|
|||||||
for domain in domains
|
for domain in domains
|
||||||
let domain_pattern .= '\|' . escape(split(domain, '://')[-1], '.')
|
let domain_pattern .= '\|' . escape(split(domain, '://')[-1], '.')
|
||||||
endfor
|
endfor
|
||||||
let base = matchstr(a:url, '^\%(https\=://\|git://\|git@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
|
let base = matchstr(a:url, '^\%(https\=://\|git://\|git@\|ssh://git@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
|
||||||
if index(domains, 'http://' . matchstr(base, '^[^:/]*')) >= 0
|
if index(domains, 'http://' . matchstr(base, '^[^:/]*')) >= 0
|
||||||
return 'http://' . tr(base, ':', '/')
|
return 'http://' . tr(base, ':', '/')
|
||||||
elseif !empty(base)
|
elseif !empty(base)
|
||||||
|
|||||||
Reference in New Issue
Block a user