mirror of
https://github.com/neovim/neovim
synced 2025-07-20 13:22:26 +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
(cherry picked from commit e5665754d1
)
This commit is contained in:
committed by
github-actions[bot]
parent
6b140ae899
commit
0c2bf55e90
@ -120,6 +120,8 @@ endfunction
|
|||||||
" Tutor Cmd: {{{1
|
" Tutor Cmd: {{{1
|
||||||
|
|
||||||
function! s:Locale()
|
function! s:Locale()
|
||||||
|
" Make sure l:lang exists before returning.
|
||||||
|
let l:lang = 'en_US'
|
||||||
if exists('v:lang') && v:lang =~ '\a\a'
|
if exists('v:lang') && v:lang =~ '\a\a'
|
||||||
let l:lang = v:lang
|
let l:lang = v:lang
|
||||||
elseif $LC_ALL =~ '\a\a'
|
elseif $LC_ALL =~ '\a\a'
|
||||||
@ -132,8 +134,6 @@ function! s:Locale()
|
|||||||
endif
|
endif
|
||||||
elseif $LANG =~ '\a\a'
|
elseif $LANG =~ '\a\a'
|
||||||
let l:lang = $LANG
|
let l:lang = $LANG
|
||||||
else
|
|
||||||
let l:lang = 'en_US'
|
|
||||||
endif
|
endif
|
||||||
return split(l:lang, '_')
|
return split(l:lang, '_')
|
||||||
endfunction
|
endfunction
|
||||||
|
Reference in New Issue
Block a user