1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Check for existence of key in dictionary before using it (#631)

This commit is contained in:
embear
2020-07-30 19:36:07 +02:00
committed by GitHub
parent 5bb0ef3576
commit 3fe9d8e13b

View File

@@ -3714,7 +3714,11 @@ function! tagbar#currenttagtype(fmt, default) abort
let typeinfo = tag.fileinfo.typeinfo
let plural = typeinfo.kinds[typeinfo.kinddict[kind]].long
let singular = s:singular_types[plural]
if has_key(plural)
let singular = s:singular_types[plural]
else
let singular = plural
endif
return printf(a:fmt, singular)
endfunction