1
0
forked from aniani/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 #7509)
This commit is contained in:
Bram Moolenaar
2020-12-21 19:59:08 +01:00
parent a3d10a508c
commit f4e2099e39
17 changed files with 98 additions and 42 deletions

View File

@@ -6996,3 +6996,22 @@ fill_culopt_flags(char_u *val, win_T *wp)
return OK;
}
#endif
/*
* Get the value of 'magic' adjusted for Vim9 script.
*/
int
magic_isset(void)
{
switch (magic_overruled)
{
case MAGIC_ON: return TRUE;
case MAGIC_OFF: return FALSE;
case MAGIC_NOT_SET: break;
}
#ifdef FEAT_EVAL
if (in_vim9script())
return TRUE;
#endif
return p_magic;
}