mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(tutor): l:lang is undefined
Problem: The scope `elseif $LC_MESSAGES =~ '\a\a' || $LC_MESSAGES ==# "C"` in function `s:Locale` in file `runtime/autoload/tutor.vim` leaves a case when l:lang is not defined. Solution: Define `l:lang` at function scope instead of `if` scope
This commit is contained in:
@ -120,6 +120,8 @@ endfunction
|
||||
" Tutor Cmd: {{{1
|
||||
|
||||
function! s:Locale()
|
||||
" Make sure l:lang exists before returning.
|
||||
let l:lang = 'en_US'
|
||||
if exists('v:lang') && v:lang =~ '\a\a'
|
||||
let l:lang = v:lang
|
||||
elseif $LC_ALL =~ '\a\a'
|
||||
@ -132,8 +134,6 @@ function! s:Locale()
|
||||
endif
|
||||
elseif $LANG =~ '\a\a'
|
||||
let l:lang = $LANG
|
||||
else
|
||||
let l:lang = 'en_US'
|
||||
endif
|
||||
return split(l:lang, '_')
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user