aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tag.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-04 08:38:38 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-04 10:07:04 +0800
commita91ba088abf7b21f640f671ad7f211c0957b4765 (patch)
treea1f206ecc559b64767e667945587b324c5ac3e12 /src/nvim/tag.c
parentfba0562723a1af143c9e9509920d03d8231b8bf7 (diff)
downloadrneovim-a91ba088abf7b21f640f671ad7f211c0957b4765.tar.gz
rneovim-a91ba088abf7b21f640f671ad7f211c0957b4765.tar.bz2
rneovim-a91ba088abf7b21f640f671ad7f211c0957b4765.zip
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) https://github.com/vim/vim/commit/f4e2099e39ed4d71aed0f9a9579455aed5ec6cc2 EX_NONWHITE_OK is N/A: only applies to Vim9 script. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r--src/nvim/tag.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index e99ac894dc..cba671600a 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -1200,7 +1200,8 @@ static void prepare_pats(pat_T *pats, int has_re)
pats->headlen = 0;
} else {
for (pats->headlen = 0; pats->head[pats->headlen] != NUL; pats->headlen++) {
- if (vim_strchr((p_magic ? ".[~*\\$" : "\\$"), pats->head[pats->headlen]) != NULL) {
+ if (vim_strchr(magic_isset() ? ".[~*\\$" : "\\$",
+ pats->head[pats->headlen]) != NULL) {
break;
}
}
@@ -1211,7 +1212,7 @@ static void prepare_pats(pat_T *pats, int has_re)
}
if (has_re) {
- pats->regmatch.regprog = vim_regcomp(pats->pat, p_magic ? RE_MAGIC : 0);
+ pats->regmatch.regprog = vim_regcomp(pats->pat, magic_isset() ? RE_MAGIC : 0);
} else {
pats->regmatch.regprog = NULL;
}
@@ -2812,7 +2813,6 @@ static char_u *tag_full_fname(tagptrs_T *tagp)
/// @return OK for success, NOTAGFILE when file not found, FAIL otherwise.
static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help)
{
- int save_magic;
bool save_p_ws;
int save_p_scs, save_p_ic;
linenr_T save_lnum;
@@ -2955,8 +2955,8 @@ static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help)
curwin->w_set_curswant = true;
postponed_split = 0;
- save_magic = p_magic;
- p_magic = false; // always execute with 'nomagic'
+ const magic_T save_magic_overruled = magic_overruled;
+ magic_overruled = MAGIC_OFF; // always execute with 'nomagic'
// Save value of no_hlsearch, jumping to a tag is not a real search
const bool save_no_hlsearch = no_hlsearch;
@@ -3063,7 +3063,7 @@ static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help)
sandbox--;
}
- p_magic = save_magic;
+ magic_overruled = save_magic_overruled;
// restore no_hlsearch when keeping the old search pattern
if (search_options) {
set_no_hlsearch(save_no_hlsearch);