Mercurial > vim
comparison src/testdir/test_substitute.vim @ 27980:40e35cefeac6 v8.2.4515
patch 8.2.4515: old subsitute syntax is still supported
Commit: https://github.com/vim/vim/commit/9fb7b42935f13b5d3407eb82b151da1e9b4b6048
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 5 21:13:26 2022 +0000
patch 8.2.4515: old subsitute syntax is still supported
Problem: Old subsitute syntax is still supported.
Solution: Disallow using backslash after ":s" in Vim9 script.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Mar 2022 22:15:02 +0100 |
parents | b4c147ad4912 |
children | 553ff405b719 |
comparison
equal
deleted
inserted
replaced
27979:48f9b7f4d67c | 27980:40e35cefeac6 |
---|---|
809 s\?amber? | 809 s\?amber? |
810 let @/ = 'white' | 810 let @/ = 'white' |
811 s\&green& | 811 s\&green& |
812 call assert_equal('amber green yellow white green', getline(1)) | 812 call assert_equal('amber green yellow white green', getline(1)) |
813 close! | 813 close! |
814 | |
815 call assert_fails('vim9cmd s\/white/', 'E1270:') | |
816 call assert_fails('vim9cmd s\?white?', 'E1270:') | |
817 call assert_fails('vim9cmd s\&white&', 'E1270:') | |
814 endfunc | 818 endfunc |
815 | 819 |
816 " Test for substitute with the new text longer than the original text | 820 " Test for substitute with the new text longer than the original text |
817 func Test_sub_expand_text() | 821 func Test_sub_expand_text() |
818 new | 822 new |