mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-21 13:04:54 +02:00
add gina support for vim-airline's branch
add check gina in util.vim fix typo add gina check fix typo add gina.vim's url in doc fix typo delete v:version > 800 fix error
This commit is contained in:
parent
9f00b402c5
commit
f8e1f85fde
@ -255,6 +255,7 @@ function! airline#extensions#load()
|
|||||||
|
|
||||||
if get(g:, 'airline#extensions#branch#enabled', 1) && (
|
if get(g:, 'airline#extensions#branch#enabled', 1) && (
|
||||||
\ airline#util#has_fugitive() ||
|
\ airline#util#has_fugitive() ||
|
||||||
|
\ airline#util#has_gina() ||
|
||||||
\ airline#util#has_lawrencium() ||
|
\ airline#util#has_lawrencium() ||
|
||||||
\ airline#util#has_vcscommand() ||
|
\ airline#util#has_vcscommand() ||
|
||||||
\ airline#util#has_custom_scm())
|
\ airline#util#has_custom_scm())
|
||||||
|
@ -85,11 +85,11 @@ let s:names = {'0': 'index', '1': 'orig', '2':'fetch', '3':'merge'}
|
|||||||
let s:sha1size = get(g:, 'airline#extensions#branch#sha1_len', 7)
|
let s:sha1size = get(g:, 'airline#extensions#branch#sha1_len', 7)
|
||||||
|
|
||||||
function! s:update_git_branch()
|
function! s:update_git_branch()
|
||||||
if !airline#util#has_fugitive()
|
if !airline#util#has_fugitive() && !airline#util#has_gina()
|
||||||
let s:vcs_config['git'].branch = ''
|
let s:vcs_config['git'].branch = ''
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
if airline#util#has_fugitive()
|
||||||
let s:vcs_config['git'].branch = exists("*FugitiveHead") ?
|
let s:vcs_config['git'].branch = exists("*FugitiveHead") ?
|
||||||
\ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
|
\ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
|
||||||
if s:vcs_config['git'].branch is# 'master' &&
|
if s:vcs_config['git'].branch is# 'master' &&
|
||||||
@ -97,6 +97,15 @@ function! s:update_git_branch()
|
|||||||
" Shorten default a bit
|
" Shorten default a bit
|
||||||
let s:vcs_config['git'].branch='mas'
|
let s:vcs_config['git'].branch='mas'
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
let g:gina#component#repo#commit_length = s:sha1size
|
||||||
|
let s:vcs_config['git'].branch = gina#component#repo#branch()
|
||||||
|
if s:vcs_config['git'].branch is# 'master' &&
|
||||||
|
\ airline#util#winwidth() < 81
|
||||||
|
" Shorten default a bit
|
||||||
|
let s:vcs_config['git'].branch='mas'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:display_git_branch()
|
function! s:display_git_branch()
|
||||||
@ -200,7 +209,7 @@ function! s:update_untracked()
|
|||||||
for vcs in keys(s:vcs_config)
|
for vcs in keys(s:vcs_config)
|
||||||
" only check, for git, if fugitive is installed
|
" only check, for git, if fugitive is installed
|
||||||
" and for 'hg' if lawrencium is installed, else skip
|
" and for 'hg' if lawrencium is installed, else skip
|
||||||
if vcs is# 'git' && !airline#util#has_fugitive()
|
if vcs is# 'git' && (!airline#util#has_fugitive())
|
||||||
continue
|
continue
|
||||||
elseif vcs is# 'mercurial' && !airline#util#has_lawrencium()
|
elseif vcs is# 'mercurial' && !airline#util#has_lawrencium()
|
||||||
continue
|
continue
|
||||||
|
@ -135,6 +135,14 @@ function! airline#util#has_fugitive()
|
|||||||
return s:has_fugitive
|
return s:has_fugitive
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! airline#util#has_gina()
|
||||||
|
if !exists("s:has_gina")
|
||||||
|
let s:has_gina = exists(':Gina')
|
||||||
|
endif
|
||||||
|
return s:has_gina
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! airline#util#has_lawrencium()
|
function! airline#util#has_lawrencium()
|
||||||
if !exists("s:has_lawrencium")
|
if !exists("s:has_lawrencium")
|
||||||
let s:has_lawrencium = exists('*lawrencium#statusline')
|
let s:has_lawrencium = exists('*lawrencium#statusline')
|
||||||
|
@ -474,6 +474,7 @@ vim-airline will display the branch-indicator together with the branch name
|
|||||||
in the statusline, if one of the following plugins is installed:
|
in the statusline, if one of the following plugins is installed:
|
||||||
|
|
||||||
fugitive.vim <https://github.com/tpope/vim-fugitive>
|
fugitive.vim <https://github.com/tpope/vim-fugitive>
|
||||||
|
gina.vim <https://github.com/lambdalisue/gina.vim>
|
||||||
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||||
vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
|
vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user