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

1 view
Skip to first unread message

Christian Brabandt

unread,
Jun 16, 2026, 3:30:13 PM (yesterday) Jun 16
to vim...@googlegroups.com
patch 9.2.0656: completion: using wrong tolower() in smartcase filtering

Commit: https://github.com/vim/vim/commit/9f5d32cf5caf2476efe4ad1da2d4455920bcc28c
Author: glepnir <gleph...@gmail.com>
Date: Tue Jun 16 19:11:38 2026 +0000

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: #20535

Signed-off-by: glepnir <gleph...@gmail.com>
Signed-off-by: zeertzjq <zeer...@outlook.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/insexpand.c b/src/insexpand.c
index a355e2949..019fd252a 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -1072,7 +1072,7 @@ ins_compl_equal_sc(compl_T *match, char_u *str, int len)
for (int i = 0; i < len; ++i)
{
if (i >= typed && i < longest_end
- ? MB_TOLOWER(match->cp_str.string[i]) != MB_TOLOWER(str[i])
+ ? TOLOWER_LOC(match->cp_str.string[i]) != TOLOWER_LOC(str[i])
: match->cp_str.string[i] != str[i])
return FALSE;
}
diff --git a/src/version.c b/src/version.c
index 56f8a6590..864688f60 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 656,
/**/
655,
/**/
Reply all
Reply to author
Forward
0 new messages