patch 9.1.1594: completion: search completion throws errors

Problem:  completion: search completion throws errors, wrong placement
          of pum menu with 'imi'=1 (berggeist)
Solution: Fix those errors (Girish Palya)

fixes: #17858
closes: #17870

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-08-06 17:12:14 +02:00
committed by Christian Brabandt
parent bb0860abc9
commit 66467cf5d8
5 changed files with 69 additions and 8 deletions

View File

@ -4789,17 +4789,29 @@ copy_substring_from_pos(pos_T *start, pos_T *end, char_u **match,
static int
is_regex_match(char_u *pat, char_u *str)
{
if (STRCMP(pat, str) == 0)
return TRUE;
regmatch_T regmatch;
int result;
++emsg_off;
++msg_silent;
regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
--emsg_off;
--msg_silent;
if (regmatch.regprog == NULL)
return FALSE;
regmatch.rm_ic = p_ic;
if (p_ic && p_scs)
regmatch.rm_ic = !pat_has_uppercase(pat);
++emsg_off;
++msg_silent;
result = vim_regexec_nl(&regmatch, str, (colnr_T)0);
--emsg_off;
--msg_silent;
vim_regfree(regmatch.regprog);
return result;