From f4e2099e39ed4d71aed0f9a9579455aed5ec6cc2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 21 Dec 2020 19:59:08 +0100 Subject: 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) --- src/option.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/option.c') diff --git a/src/option.c b/src/option.c index 935a3250e..dd09e0e76 100644 --- a/src/option.c +++ b/src/option.c @@ -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; +} -- cgit v1.2.1