vim-patch:9.0.1596: :registers command does not work in sandbox (#23866)

Problem:    :registers command does not work in sandbox.
Solution:   Add flag to the command. (closes vim/vim#12473)

eb43b7f053

Co-authored-by: Julio B <julio.bacel@gmail.com>
This commit is contained in:
zeertzjq 2023-06-01 20:28:16 +08:00 committed by GitHub
parent 2bdef6dd2a
commit 7801091062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -2212,7 +2212,7 @@ module.cmds = {
},
{
command='registers',
flags=bit.bor(EXTRA, NOTRLCOM, TRLBAR, CMDWIN, LOCK_OK),
flags=bit.bor(EXTRA, NOTRLCOM, TRLBAR, SBOXOK, CMDWIN, LOCK_OK),
addr_type='ADDR_NONE',
func='ex_display',
},

View File

@ -55,8 +55,9 @@ func Test_display_registers()
call feedkeys("i\<C-R>=2*4\n\<esc>")
call feedkeys(":ls\n", 'xt')
let a = execute('display')
let b = execute('registers')
" these commands work in the sandbox
let a = execute('sandbox display')
let b = execute('sandbox registers')
call assert_equal(a, b)
call assert_match('^\nType Name Content\n'