# HG changeset patch # User Christian Brabandt # Date 1710002703 -3600 # Node ID 408e9818595dddeaddb156c95625ca0401c38956 # Parent 89bc200aeb24fb407a63192cbc47aa2bb6627603 runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (#14162) Commit: https://github.com/vim/vim/commit/62b26040eb4b6752be2c46852e8986083737a1bb Author: dkearns Date: Sun Mar 10 03:43:28 2024 +1100 runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (https://github.com/vim/vim/issues/14162) Improve :menu and :menutranslate highlighting. - Match args to :menutranslation and :popup. - Only highlight special notation in {rhs} of :menu, like :map. - Allow line continuations in {rhs} of :menu and between {english} and {mylang} of :menutranslation, matching common usage. - Bug fixes. Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt diff --git a/runtime/syntax/generator/gen_syntax_vim.vim b/runtime/syntax/generator/gen_syntax_vim.vim --- a/runtime/syntax/generator/gen_syntax_vim.vim +++ b/runtime/syntax/generator/gen_syntax_vim.vim @@ -2,8 +2,8 @@ " Language: Vim script " Maintainer: Hirohito Higashi (h_east) " URL: https://github.com/vim-jp/syntax-vim-ex -" Last Change: 2024 Mar 02 -" Version: 2.0.4 +" Last Change: 2024 Mar 09 +" Version: 2.0.5 let s:keepcpo= &cpo set cpo&vim @@ -271,7 +271,7 @@ function! s:get_vim_command_type(cmd_nam " 6: mapclear " 7: unmap " 99: (Exclude registration of "syn keyword") - let menu_prefix = '^\%([acinosvx]\?\|tl\)' + let menu_prefix = '^\%([acinostvx]\?\|tl\)' let map_prefix = '^[acilnostvx]\?' let echo_suffix = '\%(n\|hl\|msg\|window\|err\|console\|\)$' let exclude_list = [ @@ -284,7 +284,7 @@ function! s:get_vim_command_type(cmd_nam \ 'behave', 'augroup', 'normal', 'syntax', \ 'append', 'insert', \ 'Next', 'Print', 'X', - \ 'new', + \ 'new', 'popup', \ ] " Required for original behavior " \ 'global', 'vglobal' diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -3,7 +3,7 @@ " Maintainer: Hirohito Higashi " Doug Kearns " URL: https://github.com/vim-jp/syntax-vim-ex -" Last Change: 2024 Mar 04 +" Last Change: 2024 Mar 09 " Former Maintainer: Charles E. Campbell " Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Base File Version: 9.0-25 @@ -166,7 +166,7 @@ syn match vimNumber '0[0-7]\+' s syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" @@ -478,15 +478,27 @@ syn case match " Menus: {{{2 " ===== -syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod -" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimCommand', END_STR='skipwhite nextgroup=@vimMenuList' -syn match vimMenuName "[^ \t\\<]\+" contained nextgroup=vimMenuNameMore,vimMenuMap -syn match vimMenuPriority "\d\+\(\.\d\+\)*" contained skipwhite nextgroup=vimMenuName -syn match vimMenuNameMore "\c\\\s\|\|\\\." contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation -syn match vimMenuMod contained "\c<\(script\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList -syn match vimMenuMap "\s" contained skipwhite nextgroup=vimMenuRhs -syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vim9Comment,vimIsCommand -syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList +" NOTE: tail comments disallowed +" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus' +syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName +syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" +syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" +syn match vimMenuName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs +syn match vimMenuName "\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue +syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained +syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName +syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr +syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite +syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod + +syn region vimMenutranslate + \ matchgroup=vimCommand start="\" + \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + + \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\\s\+[eE][nN][dD]" " ==================== @@ -1016,9 +1029,14 @@ if !exists("skip_vim_syntax_inits") hi def link vimMark Number hi def link vimMarkNumber vimNumber hi def link vimMenuBang vimBang + hi def link vimMenuClear Special hi def link vimMenuMod vimMapMod - hi def link vimMenuNameMore vimMenuName hi def link vimMenuName PreProc + hi def link vimMenu vimCommand + hi def link vimMenuNotation vimNotation + hi def link vimMenuPriority Number + hi def link vimMenuStatus Special + hi def link vimMenutranslateComment vimComment hi def link vimMtchComment vimComment hi def link vimNorm vimCommand hi def link vimNotation Special diff --git a/runtime/syntax/testdir/dumps/vim_ex_menu_00.dump b/runtime/syntax/testdir/dumps/vim_ex_menu_00.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menu_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |V|i|m| |:|m|e|n|u| |c|o|m@1|a|n|d|s| +0#0000000&@54 +@75 +|"+0#0000e05&| |:|h|e|l|p| |d|i|s|a|b|l|e| |m|e|n|u|s| +0#0000000&@53 +|m+0#af5f00255&|e|n|u| +0#0000000&|d+0#e000e06&|i|s|a|b|l|e| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|O|p|e|n|\|.|\|.|\|.| +0#0000000&@44 +|a+0#af5f00255&|m|e|n|u| +0#0000000&|e+0#e000e06&|n|a|b|l|e| +0#0000000&|*+0#e000e06&| +0#0000000&@60 +|a+0#af5f00255&|m|e|n|u| +0#0000000&|d+0#e000e06&|i|s|a|b|l|e| +0#0000000&|&+0#e000e06&|T|o@1|l|s|.|*| +0#0000000&@52 +@75 +@75 +|"+0#0000e05&| |:|h|e|l|p| |m|e|n|u|-|e|x|a|m|p|l|e|s| +0#0000000&@53 +|n+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|A|d@1|\| |V|a|r| +0#0000000&@8|w|b|"|z|y|e|:|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&| |<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>| +0#0000000&@9 +|n+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|R|e|m|o|v|e|\| |V|a|r| +0#0000000&@5|w|b|"|z|y|e|:|u|n|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>| +0#0000000&@14 +|v+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|A|d@1|\| |V|a|r| +0#0000000&@8|"|z|y|:|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&| |<+0#e000e06&|C|-|R|>|z+0#0000000&| |<+0#e000e06&|C|R|>| +0#0000000&@11 +|v+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|R|e|m|o|v|e|\| |V|a|r| +0#0000000&@5|"|z|y|:|u|n|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>| +0#0000000&@17 +|i+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|A|d@1|\| |V|a|r| +0#0000000&@8|<+0#e000e06&|E|s|c|>|w+0#0000000&|b|"|z|y|e|:|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&| |<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>|a+0#0000000&| @3 +|i+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|R|e|m|o|v|e|\| |V|a|r| +0#0000000&@5|<+0#e000e06&|E|s|c|>|w+0#0000000&|b|"|z|y|e|:|u|n|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>|a+0#0000000&| @8 +@75 +@75 +|"+0#0000e05&| |s|p|e|c|i|a|l| |k|e|y|s| +0#0000000&@60 +|m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&@1|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@31 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menu_01.dump b/runtime/syntax/testdir/dumps/vim_ex_menu_01.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menu_01.dump @@ -0,0 +1,20 @@ +|i+0#af5f00255#ffffff0|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|A|d@1|\| |V|a|r| +0#0000000&@8|<+0#e000e06&|E|s|c|>|w+0#0000000&|b|"|z|y|e|:|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&| |<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>|a+0#0000000&| @3 +|i+0#af5f00255&|m|e|n|u| +0#0000000&|W+0#e000e06&|o|r|d|s|.|R|e|m|o|v|e|\| |V|a|r| +0#0000000&@5|<+0#e000e06&|E|s|c|>|w+0#0000000&|b|"|z|y|e|:|u|n|m|e|n|u|!| |W|o|r|d|s|.|<+0#e000e06&|C|-|R|>|z+0#0000000&|<+0#e000e06&|C|R|>|a+0#0000000&| @8 +@75 +@75 +|"+0#0000e05&| |s|p|e|c|i|a|l| |k|e|y|s| +0#0000000&@60 +>m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&@1|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@31 +|m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|p|e|c|i|a|l|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@31 +|m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|c|r|i|p|t|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&@1|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@31 +|m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|<+0#e000e06&|s|p|e|c|i|a|l|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@22 +|m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|<+0#e000e06&|s|p|e|c|i|a|l|>| +0#0000000&|<+0#e000e06&|s|c|r|i|p|t|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@13 +@75 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60 +@2|m+0#af5f00255&|e|n|u| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|&+0#e000e06&|F|o@1|\| |b|a|r| +0#0000000&|:|e|c|h|o| |"|F|o@1|b|a|r|"|<+0#e000e06&|C|R|>| +0#0000000&@30 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +@75 +|"+0#0000e05&| +0#0000000&|E+0#e000e06&|x|a|m|p|l|e|:| +0#0000e05&|r|u|n|t|i|m|e|/|m|e|n|u|.|v|i|m| |(|m|o|d|i|f|i|e|d|)| +0#0000000&@36 +|a+0#af5f00255&|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&|:|c|o|n|f|i|r|m| |c|l|o|s|e|<+0#e000e06&|C|R|>| +0#0000000&@13 +@57|1|9|,|1| @9|2|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menu_02.dump b/runtime/syntax/testdir/dumps/vim_ex_menu_02.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menu_02.dump @@ -0,0 +1,20 @@ +|a+0#af5f00255#ffffff0|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&|:|c|o|n|f|i|r|m| |c|l|o|s|e|<+0#e000e06&|C|R|>| +0#0000000&@13 +@75 +|a+0#af5f00255&|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&@32 +@8|\+0#e000e06&| +0#0000000&|:|i|f| |w|i|n|h|e|i|g|h|t|(|2|)| |<| |0| |&@1| |t|a|b|p|a|g|e|w|i|n@1|r|(|2|)| |=@1| |0| |<+0#e000e06&|B|a|r|>| +0#0000000&@14 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |e|n|e|w| |<+0#e000e06&|B|a|r|>| +0#0000000&@44 +@8>\+0#e000e06&| +0#0000000&|e|l|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@54 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |c|l|o|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@43 +@8|\+0#e000e06&| +0#0000000&|e|n|d|i|f|<+0#e000e06&|C|R|>| +0#0000000&@55 +@75 +|a+0#af5f00255&|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&@32 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&|:|i|f| |w|i|n|h|e|i|g|h|t|(|2|)| |<| |0| |&@1| |t|a|b|p|a|g|e|w|i|n@1|r|(|2|)| |=@1| |0| |<+0#e000e06&|B|a|r|>| +0#0000000&@14 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |e|n|e|w| |<+0#e000e06&|B|a|r|>| +0#0000000&@44 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&|e|l|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@54 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |c|l|o|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@43 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@57|3|7|,|2|-|9| @7|5|7|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menu_03.dump b/runtime/syntax/testdir/dumps/vim_ex_menu_03.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menu_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@7|\+0#e000e06&| +0#0000000&|e|n|d|i|f|<+0#e000e06&|C|R|>| +0#0000000&@55 +@75 +|a+0#af5f00255&|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&|:|i|f| |w|i|n|h|e|i|g|h|t|(|2|)| |<| |0| |&@1| |t|a|b|p|a|g|e|w +|i|n@1|r|(|2|)| |=@1| |0| |<+0#e000e06&|B|a|r|>| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |e|n|e|w| |<+0#e000e06&|B|a|r|>| +0#0000000&@44 +@8>\+0#e000e06&| +0#0000000&|e|l|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@54 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |c|l|o|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@43 +@8|\+0#e000e06&| +0#0000000&|e|n|d|i|f|<+0#e000e06&|C|R|>| +0#0000000&@55 +@75 +|a+0#af5f00255&|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&|:|i|f| |w|i|n|h|e|i|g|h|t|(|2|)| |<| |0| |&@1| |t|a|b|p|a|g|e|w +|i|n@1|r|(|2|)| |=@1| |0| |<+0#e000e06&|B|a|r|>| +0#0000000&@56 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |e|n|e|w| |<+0#e000e06&|B|a|r|>| +0#0000000&@44 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&|e|l|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@54 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |c|l|o|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@43 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&|e|n|d|i|f|<+0#e000e06&|C|R|>| +0#0000000&@55 +@57|5@1|,|2|-|9| @7|8|9|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menu_99.dump b/runtime/syntax/testdir/dumps/vim_ex_menu_99.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menu_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@7|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |c|l|o|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@43 +@8|\+0#e000e06&| +0#0000000&|e|n|d|i|f|<+0#e000e06&|C|R|>| +0#0000000&@55 +@75 +|a+0#af5f00255&|n| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|1+0#e000002&|0|.|3@1|0| +0#0000000&|&+0#e000e06&|F|i|l|e|.|&|C|l|o|s|e|<|T|a|b|>|:|c|l|o|s|e| +0#0000000&|:|i|f| |w|i|n|h|e|i|g|h|t|(|2|)| |<| |0| |&@1| |t|a|b|p|a|g|e|w +|i|n@1|r|(|2|)| |=@1| |0| |<+0#e000e06&|B|a|r|>| +0#0000000&@56 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |e|n|e|w| |<+0#e000e06&|B|a|r|>| +0#0000000&@44 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&|e|l|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@54 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&@2|c|o|n|f|i|r|m| |c|l|o|s|e| |<+0#e000e06&|B|a|r|>| +0#0000000&@43 +@8|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@56 +@8|\+0#e000e06&| +0#0000000&|e|n|d|i|f|<+0#e000e06&|C|R|>| +0#0000000&@55 +@75 +@75 +|"+0#0000e05&| |p|o|p|u|p| |m|e|n|u|s| +0#0000000&@61 +|p+0#af5f00255&|o|p|u|p| +0#0000000&|&+0#e000e06&|F|o@1| +0#0000000&@1||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@50 +|p+0#af5f00255&|o|p|u|p|!| +0#0000000&|&+0#e000e06&|F|o@1| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@50 +> @74 +@57|7|3|,|0|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menutranslate_00.dump b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_00.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |V|i|m| |:|m|e|n|u|t|r|a|n|s|l|a|t|e| |c|o|m@1|a|n|d| +0#0000000&@46 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|c+0#e000e06&|l|e|a|r| +0#0000000&@55 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|c+0#e000e06&|l|e|a|r| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@42 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|c+0#e000e06&|l|e|a|r| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@45 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| |&+0#e000e06&|F|u+0#0000000&|B|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@31 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| |&+0#e000e06&|F|u+0#0000000&|B|a|r| |"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@34 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|\|"|&+0#e000e06&|F|o+0#0000000&@1|"|\+0#e000e06&| |b+0#0000000&|a|r| |\|"|&+0#e000e06&|F|u+0#0000000&|B|a|r| @39 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |"+0#0000000&|b|a|r|"| |&+0#e000e06&|F|u+0#0000000&|B|a|r| @42 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @51 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +@75 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menutranslate_01.dump b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_01.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +> @74 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@48 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| @60 +@6|\+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@54 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @51 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +@75 +@57|1|9|,|0|-|1| @7|4|0|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menutranslate_02.dump b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_02.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6>\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@48 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| @60 +@6|\+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@54 +@57|3|7|,|7| @9|9|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_menutranslate_99.dump b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_99.dump new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_menutranslate_99.dump @@ -0,0 +1,20 @@ +|m+0#af5f00255#ffffff0|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@47 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@48 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@75 +|m+0#af5f00255&|e|n|u|t|r|a|n|s|l|a|t|e| +0#0000000&@61 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|o+0#0000000&@1|\+0#e000e06&| |b+0#0000000&|a|r| @57 +@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|&+0#e000e06&|F|u+0#0000000&|b|a|r| @60 +@6|\+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@54 +> @74 +@57|5|1|,|0|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_ex_menu.vim b/runtime/syntax/testdir/input/vim_ex_menu.vim new file mode 100644 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_menu.vim @@ -0,0 +1,73 @@ +" Vim :menu commands + +" :help disable menus +menu disable &File.&Open\.\.\. +amenu enable * +amenu disable &Tools.* + + +" :help menu-examples +nmenu Words.Add\ Var wb"zye:menu! Words.z z +nmenu Words.Remove\ Var wb"zye:unmenu! Words.z +vmenu Words.Add\ Var "zy:menu! Words.z z +vmenu Words.Remove\ Var "zy:unmenu! Words.z +imenu Words.Add\ Var wb"zye:menu! Words.z za +imenu Words.Remove\ Var wb"zye:unmenu! Words.za + + +" special keys +menu &Foo\ bar :echo "Foobar" +menu &Foo\ bar :echo "Foobar" +menu