From 927e142e9474f6a4211c62ac4f26481b216efc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Tue, 29 Mar 2022 22:50:13 +0200 Subject: [PATCH] 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. --- autoload/airline/parts.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index 1cc136d0..983b98e9 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -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]