diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/insexpand.c | 2 | ||||
-rw-r--r-- | src/nvim/popupmenu.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 0a25b72451..ded5c6e3c3 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -1397,7 +1397,7 @@ bool compl_match_curr_select(int selected) /// Get current completion leader char *ins_compl_leader(void) { - return compl_leader; + return compl_leader != NULL ? compl_leader : compl_orig_text; } /// Add any identifiers that match the given pattern "pat" in the list of diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c index 2d3c128de1..8608a2c866 100644 --- a/src/nvim/popupmenu.c +++ b/src/nvim/popupmenu.c @@ -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; |