diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-22 14:59:08 +0100 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-23 02:07:21 +0100 |
| commit | f1bf70c2f9f24a1cd3b75fa762f8ca57f9ff24cf (patch) | |
| tree | b79627c8eabdbb560eee01614d59558a9a20dedc /src/nvim/testdir/test_registers.vim | |
| parent | f8241f825a87fe811fb8831f4414eaa2bad2dcfe (diff) | |
| download | rneovim-f1bf70c2f9f24a1cd3b75fa762f8ca57f9ff24cf.tar.gz rneovim-f1bf70c2f9f24a1cd3b75fa762f8ca57f9ff24cf.tar.bz2 rneovim-f1bf70c2f9f24a1cd3b75fa762f8ca57f9ff24cf.zip | |
vim-patch:8.2.1035: setreg() does not always clear the register
Problem: setreg() does not always clear the register.
Solution: Clear the register if the dict argument is empty. (Andy Massimino,
closes vim/vim#3370)
https://github.com/vim/vim/commit/7633fe595e6a27d6bb376548ff89f0dcce481600
Do not getdigits for block_len strictly. For example, a user could
previously abort Nvim using:
:call setreg("0", "abort!", "\<C-V>999999999999999999")
or, after v8.2.0924's port:
:call setreg("0", #{regcontents: ["abort!"],
\ regtype: "\<C-V>999999999999999999"})
Instead, default to 0 so block_len is -1, which acts like the selection
width was omitted (defaults to length of longest line).
Diffstat (limited to 'src/nvim/testdir/test_registers.vim')
| -rw-r--r-- | src/nvim/testdir/test_registers.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim index 601606343c..fd8653a2eb 100644 --- a/src/nvim/testdir/test_registers.vim +++ b/src/nvim/testdir/test_registers.vim @@ -352,6 +352,14 @@ func Test_set_register_dict() call assert_equal(['six'], getreginfo('0').regcontents) call assert_equal(['six'], getreginfo('"').regcontents) + let @x = 'one' + call setreg('x', {}) + call assert_equal(1, len(split(execute('reg x'), '\n'))) + + call assert_fails("call setreg('0', #{regtype: 'V'}, 'v')", 'E118:') + call assert_fails("call setreg('0', #{regtype: 'X'})", 'E475:') + call assert_fails("call setreg('0', #{regtype: 'vy'})", 'E475:') + bwipe! endfunc |