comparison src/cmdexpand.c @ 23272:a84e7abb0c92 v8.2.2182

patch 8.2.2182: Vim9: value of 'magic' is still relevant Commit: https://github.com/vim/vim/commit/f4e2099e39ed4d71aed0f9a9579455aed5ec6cc2 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 21 19:59:08 2020 +0100 patch 8.2.2182: Vim9: value of 'magic' is still relevant Problem: Vim9: value of 'magic' is still relevant. Solution: Always behave like 'magic' is on in Vim9 script (closes https://github.com/vim/vim/issues/7509)
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Dec 2020 20:00:06 +0100
parents b545334ae654
children 32a9d01c2a49
comparison
equal deleted inserted replaced
23271:50ebb4982f37 23272:a84e7abb0c92
1389 set_context_in_echohl_cmd(xp, arg); 1389 set_context_in_echohl_cmd(xp, arg);
1390 arg = skipwhite(skiptowhite(arg)); 1390 arg = skipwhite(skiptowhite(arg));
1391 if (*arg != NUL) 1391 if (*arg != NUL)
1392 { 1392 {
1393 xp->xp_context = EXPAND_NOTHING; 1393 xp->xp_context = EXPAND_NOTHING;
1394 arg = skip_regexp(arg + 1, *arg, p_magic); 1394 arg = skip_regexp(arg + 1, *arg, magic_isset());
1395 } 1395 }
1396 } 1396 }
1397 return find_nextcmd(arg); 1397 return find_nextcmd(arg);
1398 #endif 1398 #endif
1399 1399
1427 delim = *arg; 1427 delim = *arg;
1428 if (delim) 1428 if (delim)
1429 { 1429 {
1430 // skip "from" part 1430 // skip "from" part
1431 ++arg; 1431 ++arg;
1432 arg = skip_regexp(arg, delim, p_magic); 1432 arg = skip_regexp(arg, delim, magic_isset());
1433 } 1433 }
1434 // skip "to" part 1434 // skip "to" part
1435 while (arg[0] != NUL && arg[0] != delim) 1435 while (arg[0] != NUL && arg[0] != delim)
1436 { 1436 {
1437 if (arg[0] == '\\' && arg[1] != NUL) 1437 if (arg[0] == '\\' && arg[1] != NUL)
2075 tofree = alloc(len); 2075 tofree = alloc(len);
2076 vim_snprintf((char *)tofree, len, "^<SNR>\\d\\+_%s", pat + 3); 2076 vim_snprintf((char *)tofree, len, "^<SNR>\\d\\+_%s", pat + 3);
2077 pat = tofree; 2077 pat = tofree;
2078 } 2078 }
2079 2079
2080 regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0); 2080 regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
2081 if (regmatch.regprog == NULL) 2081 if (regmatch.regprog == NULL)
2082 return FAIL; 2082 return FAIL;
2083 2083
2084 // set ignore-case according to p_ic, p_scs and pat 2084 // set ignore-case according to p_ic, p_scs and pat
2085 regmatch.rm_ic = ignorecase(pat); 2085 regmatch.rm_ic = ignorecase(pat);