Fix error: key not present in dictionary "percentage"

a3b58eb7c4/doc/vim-lsp.txt (L1371)

percentage key is optional
This commit is contained in:
Kirill Kuznetsov 2021-03-21 17:40:33 +03:00 committed by GitHub
parent 09dbd09ed3
commit 75383ef2e7
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