mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
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 #3370)
This commit is contained in:
@ -485,6 +485,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
|
||||
|
||||
|
Reference in New Issue
Block a user