summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-21 19:59:08 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-21 19:59:08 +0100
commitf4e2099e39ed4d71aed0f9a9579455aed5ec6cc2 (patch)
tree40a384257e29f443c46bbaa19fb88a8eb5441b05 /src/option.c
parenta3d10a508c404a32485adc86284725e0bdc5b602 (diff)
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/option.c')
-rw-r--r--src/option.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index 935a3250e0..dd09e0e764 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;
+}