summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaoaki Ueda <nao@uedder.com>2022-05-28 15:48:07 +0900
committerNaoaki Ueda <nao@uedder.com>2022-05-28 15:52:01 +0900
commit1cb19882ee80106ea081ac908a1faf7f6c048693 (patch)
tree410b65d0a2236233bbab9fd18cade96c5e0793b1
parent8797e3eb99643bf4eeaa319e88b5e307f51e756b (diff)
downloadvimrc-1cb19882ee80106ea081ac908a1faf7f6c048693.tar.gz
vimrc-1cb19882ee80106ea081ac908a1faf7f6c048693.tar.bz2
vimrc-1cb19882ee80106ea081ac908a1faf7f6c048693.zip
Change some settings for fugitive updated
-rw-r--r--_config/101-lightline.vim34
1 files changed, 12 insertions, 22 deletions
diff --git a/_config/101-lightline.vim b/_config/101-lightline.vim
index 75c9790..dcee2e2 100644
--- a/_config/101-lightline.vim
+++ b/_config/101-lightline.vim
@@ -17,37 +17,27 @@ let g:lightline = {
\ 'linter_errors': 'error'
\ },
\ 'component_function': {
-\ 'gitbranch': 'fugitive#head'
+\ 'gitbranch': 'FugitiveHead'
\ },
\ }
function! LightlineLinterWarnings() abort
- let l:counts = ale#statusline#Count(bufnr(''))
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
- return l:counts.total == 0 ? '' : printf('%d ◆', all_non_errors)
+ let l:counts = lsp#ui#vim#diagnostics#get_buffer_diagnostics_counts()
+ return l:counts.warning == 0 ? '' : printf('W:%d', l:counts.warning)
endfunction
function! LightlineLinterErrors() abort
- let l:counts = ale#statusline#Count(bufnr(''))
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
- return l:counts.total == 0 ? '' : printf('%d ✗', all_errors)
+ let l:counts = lsp#ui#vim#diagnostics#get_buffer_diagnostics_counts()
+ return l:counts.error == 0 ? '' : printf('E:%d', l:counts.error)
endfunction
function! LightlineLinterOK() abort
- let l:counts = ale#statusline#Count(bufnr(''))
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
- return l:counts.total == 0 ? '✓ ' : ''
+ let l:counts = lsp#ui#vim#diagnostics#get_buffer_diagnostics_counts()
+ let l:total = l:counts.error + l:counts.warning
+ return l:total == 0 ? 'OK' : ''
endfunction
-" Update and show lightline but only if it's visible (e.g., not in Goyo)
-function! s:MaybeUpdateLightline()
- if exists('#lightline')
- call lightline#update()
- end
-endfunction
-
-autocmd User ALELint call s:MaybeUpdateLightline()
-
+augroup LightLineOnLSP
+ autocmd!
+ autocmd User lsp_diagnostics_updated call lightline#update()
+augroup END