mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] fix coc in the statusline
This commit is contained in:
parent
343a51db0b
commit
3e272ffaaf
1 changed files with 10 additions and 6 deletions
|
@ -105,9 +105,7 @@ endif
|
|||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#ale#enabled = 1
|
||||
|
||||
if exists("*coc#status")
|
||||
call airline#parts#define_function('coc#status', 'coc#status')
|
||||
endif
|
||||
|
||||
function StatusLine_filesize()
|
||||
let l:bytes = getfsize(expand('%'))
|
||||
|
@ -134,10 +132,16 @@ endif
|
|||
let g:airline_section_{a:section} = g:airline_section_{a:section} . airline#section#create_left([''] + a:items)
|
||||
endfunction
|
||||
function s:tweak_airline()
|
||||
if exists('*coc#status')
|
||||
call s:airline_section_prepend('x', ['coc#status'])
|
||||
endif
|
||||
call s:airline_section_append('y', ['filesize'])
|
||||
if exists('*airline#extensions#coc#get_error')
|
||||
call s:airline_section_prepend('error', ['coc_error_count'])
|
||||
endif
|
||||
if exists('*airline#extensions#coc#get_warning')
|
||||
call s:airline_section_prepend('warning', ['coc_warning_count'])
|
||||
endif
|
||||
endfunction
|
||||
augroup vimrc-interface-airline
|
||||
autocmd!
|
||||
|
|
Loading…
Reference in a new issue