From 60f63100b9bc1d24b7b80c81f43cf2fc3da95987 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 21 Dec 2020 20:32:43 +0100 Subject: patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used Problem: Vim9: value of 'edcompatible' and 'gdefault' are used. Solution: Ignore these deprecated options in Vim9 script. (closes #7508) --- src/ex_cmds.c | 9 +++++++++ src/testdir/test_vim9_cmd.vim | 13 +++++++++++++ src/version.c | 2 ++ 3 files changed, 24 insertions(+) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 01f14cd58..a2b60c988 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -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 diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 3b8a7a45e..f05872ef2 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -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 diff --git a/src/version.c b/src/version.c index 41040af68..bebfa115e 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2183, /**/ 2182, /**/ -- cgit v1.2.1