From 1abb41f38e530c7d059fedc5ff8a08a38670b72f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 17 Jun 2026 08:57:08 +0800 Subject: [PATCH] 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 https://github.com/vim/vim/commit/9f5d32cf5caf2476efe4ad1da2d4455920bcc28c Co-authored-by: glepnir --- src/nvim/insexpand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 4d163d7e5b..fd3a0309f7 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -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; }