comparison src/vim9compile.c @ 24608:cb031f421ece v8.2.2843

patch 8.2.2843: Vim9: skip argument to searchpairpos() is not compiled Commit: https://github.com/vim/vim/commit/f06ab6ba388c1ac907adbbde95b63769f67bc59b Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 7 19:44:21 2021 +0200 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().
author Bram Moolenaar <Bram@vim.org>
date Fri, 07 May 2021 19:45:03 +0200
parents a4fda40e0bb9
children 07b3d21a8b4b
comparison
equal deleted inserted replaced
24607:b7f9a322190c 24608:cb031f421ece
3283 return FAIL; 3283 return FAIL;
3284 } 3284 }
3285 vim_strncpy(namebuf, *arg, varlen); 3285 vim_strncpy(namebuf, *arg, varlen);
3286 name = fname_trans_sid(namebuf, fname_buf, &tofree, &error); 3286 name = fname_trans_sid(namebuf, fname_buf, &tofree, &error);
3287 3287
3288 // we handle the "skip" argument of searchpair() differently 3288 // We handle the "skip" argument of searchpair() and searchpairpos()
3289 is_searchpair = (varlen == 10 && STRNCMP(*arg, "searchpair", 10) == 0); 3289 // differently.
3290 is_searchpair = (varlen == 6 && STRNCMP(*arg, "search", 6) == 0)
3291 || (varlen == 9 && STRNCMP(*arg, "searchpos", 9) == 0)
3292 || (varlen == 10 && STRNCMP(*arg, "searchpair", 10) == 0)
3293 || (varlen == 13 && STRNCMP(*arg, "searchpairpos", 13) == 0);
3290 3294
3291 *arg = skipwhite(*arg + varlen + 1); 3295 *arg = skipwhite(*arg + varlen + 1);
3292 if (compile_arguments(arg, cctx, &argcount, is_searchpair) == FAIL) 3296 if (compile_arguments(arg, cctx, &argcount, is_searchpair) == FAIL)
3293 goto theend; 3297 goto theend;
3294 3298