vim-patch:9.2.0656: completion: using wrong tolower() in smartcase filtering

Problem:  ins_compl_equal_sc() uses MB_TOLOWER() on single bytes, but
          it indexes raw bytes, not decoded characters (after v9.1.0651).
Solution: Use TOLOWER_LOC(), matching what STRNICMP()/ins_compl_equal()
          does (glephunter).

closes: vim/vim#20535

9f5d32cf5c

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq
2026-06-17 08:57:08 +08:00
parent 62cb36927d
commit 1abb41f38e

View File

@@ -1107,7 +1107,7 @@ static bool ins_compl_equal_sc(compl_T *match, char *str, size_t len)
for (int i = 0; (size_t)i < len; i++) {
if (i >= typed && i < longest_end
? mb_tolower((uint8_t)match->cp_str.data[i]) != mb_tolower((uint8_t)str[i])
? TOLOWER_LOC((uint8_t)match->cp_str.data[i]) != TOLOWER_LOC((uint8_t)str[i])
: match->cp_str.data[i] != str[i]) {
return false;
}