vim-patch:9.1.0496: matched text is highlighted case-sensitively

Problem:  matched text is highlighted case-sensitively
Solution: use MB_STRNICMP, update highlighting when the base changes
          (glepnir)

fixes: vim/vim#15021
closes: vim/vim#15023

f189138b39

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq
2024-06-18 06:02:01 +08:00
parent c429c5f86f
commit c2491fbab4
4 changed files with 53 additions and 3 deletions

View File

@@ -448,7 +448,8 @@ static int *pum_compute_text_attrs(char *text, hlf_T hlf)
return NULL;
}
char *leader = State == MODE_CMDLINE ? cmdline_compl_pattern() : ins_compl_leader();
char *leader = State == MODE_CMDLINE ? cmdline_compl_pattern()
: ins_compl_leader();
if (leader == NULL || *leader == NUL) {
return NULL;
}
@@ -464,7 +465,7 @@ static int *pum_compute_text_attrs(char *text, hlf_T hlf)
if (in_fuzzy) {
ga = fuzzy_match_str_with_pos(text, leader);
} else {
matched_start = strncmp(text, leader, leader_len) == 0;
matched_start = mb_strnicmp(text, leader, leader_len) == 0;
}
const char *ptr = text;