mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-05-11 09:08:25 +08:00
prefer function name instead of funcref.
This commit is contained in:
@@ -26,6 +26,6 @@ function! airline#extensions#bufferline#init(ext)
|
||||
let g:bufferline_separator = ' '
|
||||
|
||||
if g:airline_section_c == '%f%m'
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#bufferline#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#bufferline#apply')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -8,5 +8,5 @@ function! airline#extensions#commandt#apply(...)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#commandt#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#commandt#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#commandt#apply')
|
||||
endfunction
|
||||
|
||||
@@ -27,6 +27,6 @@ function! airline#extensions#csv#apply(...)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#csv#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#csv#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#csv#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -59,6 +59,6 @@ function! airline#extensions#ctrlp#init(ext)
|
||||
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
|
||||
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
|
||||
\ }
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#ctrlp#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#ctrlp#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ endif
|
||||
" First you should follow the convention and define an 'init' function.
|
||||
" It takes a single argument, which is the 'ext'ension manager of sorts,
|
||||
" which you can invoke certain functions. The most important one is
|
||||
" 'add_statusline_funcref', which as the name implies, adds a funcref to
|
||||
" 'add_statusline_func', which as the name implies, adds a function to
|
||||
" the collection such that it will be invoked prior to changes being made
|
||||
" to the statusline. Finally, invoke this init function in the
|
||||
" 'extensions.vim' file after a check to a non-autoloaded variable,
|
||||
" command, or function.
|
||||
function! airline#extensions#example#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#example#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#example#apply')
|
||||
|
||||
" Alternatively, you can also modify the default global section by
|
||||
" appending or prepending to it. But read on to see why using the funcref
|
||||
|
||||
@@ -7,6 +7,6 @@ function! airline#extensions#syntastic#apply(...)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#syntastic#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ function! s:check_statusline()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tagbar#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#tagbar#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#tagbar#apply')
|
||||
|
||||
let g:airline_section_x = '%(%{get(w:,"airline_active",0) ? tagbar#currenttag("%s","") : ""} '
|
||||
\ .g:airline_right_alt_sep.' %)'.g:airline_section_x
|
||||
|
||||
@@ -16,6 +16,6 @@ function! airline#extensions#undotree#apply(...)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#undotree#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#undotree#apply'))
|
||||
call a:ext.add_statusline_func('airline#extensions#undotree#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ endfunction
|
||||
function! airline#extensions#whitespace#init(...)
|
||||
if !s:initialized
|
||||
let s:initialized = 1
|
||||
call add(g:airline_statusline_funcrefs, function('airline#extensions#whitespace#apply'))
|
||||
call airline#add_statusline_func('airline#extensions#whitespace#apply')
|
||||
endif
|
||||
|
||||
unlet! b:airline_whitespace_check
|
||||
|
||||
Reference in New Issue
Block a user