vim-patch:9.1.2040: :tlunmenu incorrectly accepts a range (#37206)

Problem:  :tlnumenu incorrectly accepts a range.
Solution: Remove EX_RANGE and EX_ZEROR from the command definition and
          use ADDR_NONE (Doug Kearns).

closes: vim/vim#19055

19442ad118

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
zeertzjq
2026-01-03 09:41:38 +08:00
committed by GitHub
parent cde32b3307
commit 6deb1c1bf3
2 changed files with 8 additions and 2 deletions

View File

@@ -2917,8 +2917,8 @@ M.cmds = {
},
{
command = 'tlunmenu',
flags = bit.bor(RANGE, ZEROR, EXTRA, TRLBAR, NOTRLCOM, CTRLV, CMDWIN, LOCK_OK),
addr_type = 'ADDR_OTHER',
flags = bit.bor(EXTRA, TRLBAR, NOTRLCOM, CTRLV, CMDWIN, LOCK_OK),
addr_type = 'ADDR_NONE',
func = 'ex_menu',
},
{

View File

@@ -160,6 +160,12 @@ func Test_menu_errors()
unmenu Test
endfunc
func Test_unmenu_range_errors()
for prefix in ['', 'a', 'c', 'i', 'n', 's', 't', 'tl', 'v', 'x']
call assert_fails('42' .. prefix .. 'unmenu', 'E481:')
endfor
endfunc
" Test for menu item completion in command line
func Test_menu_expand()
" Create the menu items for test