aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-02-24 11:20:37 +0800
committerGitHub <noreply@github.com>2025-02-24 11:20:37 +0800
commit01236c3bfeba90a254de75ec720543baf75e6632 (patch)
treec40b5597a05bd2b1a333be2693c4d4b7360a7d07 /test/functional
parent268a3de0a7737155eb5ab1372a9ed76599751847 (diff)
downloadrneovim-01236c3bfeba90a254de75ec720543baf75e6632.tar.gz
rneovim-01236c3bfeba90a254de75ec720543baf75e6632.tar.bz2
rneovim-01236c3bfeba90a254de75ec720543baf75e6632.zip
vim-patch:9.1.1143: illegal memory access when putting a register (#32604)
Problem: illegal memory access when putting a register Solution: make sure cursor column doesn't become negative https://github.com/vim/vim/commit/e0029daa3599529d9d438cc51c7ada8580297a39 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/register_spec.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/functional/legacy/register_spec.lua b/test/functional/legacy/register_spec.lua
new file mode 100644
index 0000000000..df470f3009
--- /dev/null
+++ b/test/functional/legacy/register_spec.lua
@@ -0,0 +1,25 @@
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
+
+local clear = n.clear
+local exec = n.exec
+local assert_alive = n.assert_alive
+local fn = n.fn
+local eq = t.eq
+
+describe('registers', function()
+ before_each(clear)
+
+ -- oldtest: Test_register_cursor_column_negative()
+ it('no negative column when pasting', function()
+ exec([[
+ f XREGISTER
+ call setline(1, 'abcdef a')
+ call setreg("a", "\n", 'c')
+ call cursor(1, 7)
+ call feedkeys("i\<C-R>\<C-P>azyx$#\<esc>", 't')
+ ]])
+ assert_alive()
+ eq('XREGISTER', fn.bufname())
+ end)
+end)