Merge pull request #2357 from miuirussia/patch-1

Fix error: key not present in dictionary "percentage"
This commit is contained in:
Christian Brabandt 2021-03-27 17:12:04 +01:00 committed by GitHub
commit cba392dd7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -71,14 +71,14 @@ function! airline#extensions#lsp#progress() abort
" show only most new progress
let s:lsp_progress = s:lsp_progress[0]
if s:lsp_progress['message'] !=# '' && s:lsp_progress['percentage'] !=# 100
if s:lsp_progress['message'] !=# ''
let percent = ''
if s:lsp_progress['percentage'] >= 0
if has_key(s:lsp_progress, 'percentage') && s:lsp_progress['percentage'] >= 0
let percent = ' ' . string(s:lsp_progress['percentage']) . '%'
endif
let s:title = s:lsp_progress['title']
let message = airline#util#shorten(s:lsp_progress['message'] . percent, 91, 9)
return s:lsp_progress['server'] . ':' . s:title . ' ' . message
return s:lsp_progress['server'] . ': ' . s:title . ' ' . message
endif
endif
endif