Skip to content

Commit

Permalink
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Browse files Browse the repository at this point in the history
Problem:    Vim9: value of 'edcompatible' and 'gdefault' are used.
Solution:   Ignore these deprecated options in Vim9 script. (closes #7508)
  • Loading branch information
brammool committed Dec 21, 2020
1 parent f4e2099 commit 60f6310
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ex_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/testdir/test_vim9_cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2183,
/**/
2182,
/**/
Expand Down

0 comments on commit 60f6310

Please sign in to comment.