diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-01-17 20:15:42 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2023-01-17 20:26:12 +0800 |
| commit | c416da9d1a41b919412d88aecf827aebb8ea973b (patch) | |
| tree | 8d9c872732f56feb3175819b1f532250f7e0717c /src/nvim/testdir | |
| parent | 8aece0089dab9d1d22462de8a36bba2ee3fa1188 (diff) | |
| download | rneovim-c416da9d1a41b919412d88aecf827aebb8ea973b.tar.gz rneovim-c416da9d1a41b919412d88aecf827aebb8ea973b.tar.bz2 rneovim-c416da9d1a41b919412d88aecf827aebb8ea973b.zip | |
vim-patch:8.2.5126: substitute may overrun destination buffer
Problem: Substitute may overrun destination buffer.
Solution: Disallow switching buffers in a substitute expression.
https://github.com/vim/vim/commit/d6211a52ab9f53b82f884561ed43d2fe4d24ff7d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_substitute.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim index 5fd30c7da7..c99a0d456d 100644 --- a/src/nvim/testdir/test_substitute.vim +++ b/src/nvim/testdir/test_substitute.vim @@ -1076,6 +1076,19 @@ func Test_sub_open_cmdline_win() call delete('Xresult') endfunc +" This was editing a script file from the expression +func Test_sub_edit_scriptfile() + new + norm o0000000000000000000000000000000000000000000000000000 + func EditScript() + silent! scr! Xfile + endfunc + s/\%')/\=EditScript() + + delfunc EditScript + bwipe! +endfunc + " Test for the 2-letter and 3-letter :substitute commands func Test_substitute_short_cmd() new |