]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used v8.2.2183
authorBram Moolenaar <Bram@vim.org>
Mon, 21 Dec 2020 19:32:43 +0000 (20:32 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 21 Dec 2020 19:32:43 +0000 (20:32 +0100)
Problem:    Vim9: value of 'edcompatible' and 'gdefault' are used.
Solution:   Ignore these deprecated options in Vim9 script. (closes #7508)

src/ex_cmds.c
src/testdir/test_vim9_cmd.vim
src/version.c

index 01f14cd581b6dfcaf3410d344600e5c6c8885267..a2b60c9886ab67b6622d725ca82fffa393841afe 100644 (file)
@@ -3778,6 +3778,15 @@ ex_substitute(exarg_T *eap)
        ++cmd;
     else
     {
+#ifdef FEAT_EVAL
+       if (in_vim9script())
+       {
+           // ignore 'gdefault' and 'edcompatible'
+           subflags.do_all = FALSE;
+           subflags.do_ask = FALSE;
+       }
+       else
+#endif
        if (!p_ed)
        {
            if (p_gd)           // default is global on
index 3b8a7a45e386dae2ca3f8a6d8c671dd92af15977..f05872ef23d55a78467815fc1d80f2860b5ad144 100644 (file)
@@ -740,4 +740,17 @@ def Test_magic_not_used()
   bwipe!
 enddef
 
+def Test_gdefault_not_used()
+  new
+  for cmd in ['set gdefault', 'set nogdefault']
+    exe cmd
+    setline(1, 'aaa')
+    s/./b/
+    assert_equal('baa', getline(1))
+  endfor
+
+  set nogdefault
+  bwipe!
+enddef
+
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
index 41040af6821749b9263c0dc5d1fc9a53868d4157..bebfa115ee2a1be73003405e6d52e81fbd013cc5 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2183,
 /**/
     2182,
 /**/