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:
Fedor 2021-11-03 15:27:47 +03:00 committed by GitHub
parent ddaf69804a
commit f0ee8f193e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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