comparison src/testdir/test_substitute.vim @ 29214:9e0b45df95b0 v8.2.5126

patch 8.2.5126: substitute may overrun destination buffer Commit: https://github.com/vim/vim/commit/d6211a52ab9f53b82f884561ed43d2fe4d24ff7d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 18 19:48:14 2022 +0100 patch 8.2.5126: substitute may overrun destination buffer Problem: Substitute may overrun destination buffer. Solution: Disallow switching buffers in a substitute expression.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 Jun 2022 21:00:04 +0200
parents f371242b6a23
children 5ebc561444fe
comparison
equal deleted inserted replaced
29213:6400a0abf095 29214:9e0b45df95b0
1061 1061
1062 call delete('Xscript') 1062 call delete('Xscript')
1063 call delete('Xresult') 1063 call delete('Xresult')
1064 endfunc 1064 endfunc
1065 1065
1066 " This was editing a script file from the expression
1067 func Test_sub_edit_scriptfile()
1068 new
1069 norm o0000000000000000000000000000000000000000000000000000
1070 func EditScript()
1071 silent! scr! Xfile
1072 endfunc
1073 s/\%')/\=EditScript()
1074
1075 delfunc EditScript
1076 bwipe!
1077 endfunc
1078
1066 " Test for the 2-letter and 3-letter :substitute commands 1079 " Test for the 2-letter and 3-letter :substitute commands
1067 func Test_substitute_short_cmd() 1080 func Test_substitute_short_cmd()
1068 new 1081 new
1069 call setline(1, ['one', 'one one one']) 1082 call setline(1, ['one', 'one one one'])
1070 s/one/two 1083 s/one/two