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/testdir/test_vim9_cmd.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/testdir/test_vim9_cmd.vim') diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index d297931bc..3b8a7a45e 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -722,4 +722,22 @@ def Test_command_not_recognized() CheckDefFailure(lines, 'E1146:', 1) enddef +def Test_magic_not_used() + new + for cmd in ['set magic', 'set nomagic'] + exe cmd + setline(1, 'aaa') + s/.../bbb/ + assert_equal('bbb', getline(1)) + endfor + + set magic + setline(1, 'aaa') + assert_fails('s/.\M../bbb/', 'E486:') + assert_fails('snomagic/.../bbb/', 'E486:') + assert_equal('aaa', getline(1)) + + bwipe! +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker -- cgit v1.2.1