mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 13:26:46 +08:00
Allow user to hide CoC status in the section C
Hello. This PR should solve my pain as CoC user, that CoC status takes too much space in the C section, right after the file path. It looks like a waste of space on splitscreen or a small screen. So I added an option to set g:airline#extensions#coc#show_coc_status = 0 and the status will be hidden. By default it works like usual.
This commit is contained in:
parent
ddaf69804a
commit
f0ee8f193e
|
@ -6,6 +6,7 @@ scriptencoding utf-8
|
|||
|
||||
let s:error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:')
|
||||
let s:show_coc_status = get(g:, 'airline#extensions#coc#show_coc_status', 1)
|
||||
|
||||
function! airline#extensions#coc#get_warning() abort
|
||||
return airline#extensions#coc#get('warning')
|
||||
|
@ -37,7 +38,8 @@ endfunction
|
|||
|
||||
function! airline#extensions#coc#get_status() abort
|
||||
" Shorten text for windows < 91 characters
|
||||
return airline#util#shorten(get(g:, 'coc_status', ''), 91, 9)
|
||||
let status = airline#util#shorten(get(g:, 'coc_status', ''), 91, 9)
|
||||
return (s:show_coc_status ? status : '')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#coc#get_current_function() abort
|
||||
|
|
Loading…
Reference in New Issue
Block a user