Don't use flags in spell when spelllang disabled

In vimscript, `0 ==? 'foo'` is true, as it converts the string to a
number which results in 0 for non-numeric strings.
This commit is contained in:
Jonathan Müller 2022-03-29 22:50:13 +02:00
parent a306a7abfd
commit 927e142e94

View File

@ -146,7 +146,7 @@ function! airline#parts#spell()
let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : ''
if g:airline_detect_spell && (&spell || (exists('g:airline_spell_check_command') && eval(g:airline_spell_check_command)))
if g:airline_detect_spelllang ==? 'flag'
if g:airline_detect_spelllang && g:airline_detect_spelllang ==? 'flag'
let spelllang = tolower(&spelllang)
if has_key(s:flags, spelllang)
return s:flags[spelllang]