0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2843: Vim9: skip argument to searchpairpos() is not compiled

Problem:    Vim9: skip argument to searchpairpos() is not compiled.
Solution:   Handle like searchpair().  Also for search() and searchpos().
This commit is contained in:
Bram Moolenaar
2021-05-07 19:44:21 +02:00
parent f18332fb9e
commit f06ab6ba38
3 changed files with 29 additions and 2 deletions

View File

@@ -3285,8 +3285,12 @@ compile_call(
vim_strncpy(namebuf, *arg, varlen);
name = fname_trans_sid(namebuf, fname_buf, &tofree, &error);
// we handle the "skip" argument of searchpair() differently
is_searchpair = (varlen == 10 && STRNCMP(*arg, "searchpair", 10) == 0);
// We handle the "skip" argument of searchpair() and searchpairpos()
// differently.
is_searchpair = (varlen == 6 && STRNCMP(*arg, "search", 6) == 0)
|| (varlen == 9 && STRNCMP(*arg, "searchpos", 9) == 0)
|| (varlen == 10 && STRNCMP(*arg, "searchpair", 10) == 0)
|| (varlen == 13 && STRNCMP(*arg, "searchpairpos", 13) == 0);
*arg = skipwhite(*arg + varlen + 1);
if (compile_arguments(arg, cctx, &argcount, is_searchpair) == FAIL)