1
0
forked from aniani/vim

patch 8.1.0510: filter test fails when $LANG is C.UTF-8

Problem:    Filter test fails when $LANG is C.UTF-8.
Solution:   Set 'helplang' to "en" for any C language. (Christian Brabandt,
            closes #3577)
This commit is contained in:
Bram Moolenaar
2018-11-04 14:40:47 +01:00
parent 0b38f54730
commit dcd71cbaed
2 changed files with 9 additions and 1 deletions

View File

@@ -4256,12 +4256,18 @@ set_helplang_default(char_u *lang)
p_hlg = empty_option;
else
{
/* zh_CN becomes "cn", zh_TW becomes "tw". */
// zh_CN becomes "cn", zh_TW becomes "tw"
if (STRNICMP(p_hlg, "zh_", 3) == 0 && STRLEN(p_hlg) >= 5)
{
p_hlg[0] = TOLOWER_ASC(p_hlg[3]);
p_hlg[1] = TOLOWER_ASC(p_hlg[4]);
}
// any C like setting, such as C.UTF-8, becomes "en"
else if (STRLEN(p_hlg) >= 1 && *p_hlg == 'C')
{
p_hlg[0] = 'e';
p_hlg[1] = 'n';
}
p_hlg[2] = NUL;
}
options[idx].flags |= P_ALLOCED;