comparison src/testdir/test_substitute.vim @ 29002:48d74a5822eb v8.2.5023

patch 8.2.5023: substitute overwrites allocated buffer Commit: https://github.com/vim/vim/commit/338f1fc0ee3ca929387448fe464579d6113fa76a Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 26 15:56:23 2022 +0100 patch 8.2.5023: substitute overwrites allocated buffer Problem: Substitute overwrites allocated buffer. Solution: Disallow undo when in a substitute command.
author Bram Moolenaar <Bram@vim.org>
date Thu, 26 May 2022 17:00:05 +0200
parents 1890fa76a634
children e150d0e4701f
comparison
equal deleted inserted replaced
29001:b41690e48e21 29002:48d74a5822eb
1011 bwipe! 1011 bwipe!
1012 bwipe! 1012 bwipe!
1013 delfunc Repl 1013 delfunc Repl
1014 endfunc 1014 endfunc
1015 1015
1016 " This was undoign a change in between computing the length and using it.
1017 func Do_Test_sub_undo_change()
1018 new
1019 norm o0000000000000000000000000000000000000000000000000000
1020 silent! s/\%')/\=Repl()
1021 bwipe!
1022 endfunc
1023
1024 func Test_sub_undo_change()
1025 func Repl()
1026 silent! norm g-
1027 endfunc
1028 call Do_Test_sub_undo_change()
1029
1030 func! Repl()
1031 silent earlier
1032 endfunc
1033 call Do_Test_sub_undo_change()
1034
1035 delfunc Repl
1036 endfunc
1037
1016 " Test for the 2-letter and 3-letter :substitute commands 1038 " Test for the 2-letter and 3-letter :substitute commands
1017 func Test_substitute_short_cmd() 1039 func Test_substitute_short_cmd()
1018 new 1040 new
1019 call setline(1, ['one', 'one one one']) 1041 call setline(1, ['one', 'one one one'])
1020 s/one/two 1042 s/one/two