diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-21 19:59:08 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-21 19:59:08 +0100 |
commit | f4e2099e39ed4d71aed0f9a9579455aed5ec6cc2 (patch) | |
tree | 40a384257e29f443c46bbaa19fb88a8eb5441b05 /src/search.c | |
parent | a3d10a508c404a32485adc86284725e0bdc5b602 (diff) | |
download | vim-git-f4e2099e39ed4d71aed0f9a9579455aed5ec6cc2.tar.gz |
patch 8.2.2182: Vim9: value of 'magic' is still relevantv8.2.2182
Problem: Vim9: value of 'magic' is still relevant.
Solution: Always behave like 'magic' is on in Vim9 script (closes #7509)
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/search.c b/src/search.c index f95bf3c53..af2b80259 100644 --- a/src/search.c +++ b/src/search.c @@ -134,7 +134,7 @@ search_regcomp( int i; rc_did_emsg = FALSE; - magic = p_magic; + magic = magic_isset(); /* * If no pattern given, use a previously defined pattern. @@ -1341,7 +1341,8 @@ do_search( * If there is a matching '/' or '?', toss it. */ ps = strcopy; - p = skip_regexp_ex(pat, search_delim, (int)p_magic, &strcopy, NULL); + p = skip_regexp_ex(pat, search_delim, magic_isset(), + &strcopy, NULL); if (strcopy != ps) { // made a copy of "pat" to change "\?" to "?" @@ -3385,7 +3386,7 @@ find_pattern_in_path( sprintf((char *)pat, whole ? "\\<%.*s\\>" : "%.*s", len, ptr); // ignore case according to p_ic, p_scs and pat regmatch.rm_ic = ignorecase(pat); - regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0); + regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0); vim_free(pat); if (regmatch.regprog == NULL) goto fpip_end; @@ -3393,7 +3394,8 @@ find_pattern_in_path( inc_opt = (*curbuf->b_p_inc == NUL) ? p_inc : curbuf->b_p_inc; if (*inc_opt != NUL) { - incl_regmatch.regprog = vim_regcomp(inc_opt, p_magic ? RE_MAGIC : 0); + incl_regmatch.regprog = vim_regcomp(inc_opt, + magic_isset() ? RE_MAGIC : 0); if (incl_regmatch.regprog == NULL) goto fpip_end; incl_regmatch.rm_ic = FALSE; // don't ignore case in incl. pat. @@ -3401,7 +3403,8 @@ find_pattern_in_path( if (type == FIND_DEFINE && (*curbuf->b_p_def != NUL || *p_def != NUL)) { def_regmatch.regprog = vim_regcomp(*curbuf->b_p_def == NUL - ? p_def : curbuf->b_p_def, p_magic ? RE_MAGIC : 0); + ? p_def : curbuf->b_p_def, + magic_isset() ? RE_MAGIC : 0); if (def_regmatch.regprog == NULL) goto fpip_end; def_regmatch.rm_ic = FALSE; // don't ignore case in define pat. |