mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
vim-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 vim/vim#7509)
f4e2099e39
EX_NONWHITE_OK is N/A: only applies to Vim9 script.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -138,7 +138,7 @@ int search_regcomp(char_u *pat, int pat_save, int pat_use, int options, regmmatc
|
||||
int i;
|
||||
|
||||
rc_did_emsg = false;
|
||||
magic = p_magic;
|
||||
magic = magic_isset();
|
||||
|
||||
// If no pattern given, use a previously defined pattern.
|
||||
if (pat == NULL || *pat == NUL) {
|
||||
@@ -1089,7 +1089,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char *pat, long count, i
|
||||
// Find end of regular expression.
|
||||
// If there is a matching '/' or '?', toss it.
|
||||
ps = (char_u *)strcopy;
|
||||
p = skip_regexp_ex(pat, search_delim, p_magic, &strcopy, NULL);
|
||||
p = skip_regexp_ex(pat, search_delim, magic_isset(), &strcopy, NULL);
|
||||
if (strcopy != (char *)ps) {
|
||||
// made a copy of "pat" to change "\?" to "?"
|
||||
searchcmdlen += (int)(strlen(pat) - strlen(strcopy));
|
||||
@@ -3468,7 +3468,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool
|
||||
snprintf((char *)pat, patlen, whole ? "\\<%.*s\\>" : "%.*s", (int)len, ptr);
|
||||
// ignore case according to p_ic, p_scs and pat
|
||||
regmatch.rm_ic = ignorecase(pat);
|
||||
regmatch.regprog = vim_regcomp((char *)pat, p_magic ? RE_MAGIC : 0);
|
||||
regmatch.regprog = vim_regcomp((char *)pat, magic_isset() ? RE_MAGIC : 0);
|
||||
xfree(pat);
|
||||
if (regmatch.regprog == NULL) {
|
||||
goto fpip_end;
|
||||
@@ -3476,7 +3476,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool
|
||||
}
|
||||
char *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;
|
||||
}
|
||||
@@ -3485,7 +3485,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool
|
||||
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);
|
||||
magic_isset() ? RE_MAGIC : 0);
|
||||
if (def_regmatch.regprog == NULL) {
|
||||
goto fpip_end;
|
||||
}
|
||||
|
Reference in New Issue
Block a user