0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

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)
This commit is contained in:
Bram Moolenaar
2020-12-21 19:59:08 +01:00
parent a3d10a508c
commit f4e2099e39
17 changed files with 98 additions and 42 deletions

View File

@@ -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