Mercurial > vim
comparison runtime/syntax/testdir/input/vim_ex_menu.vim @ 34510:408e9818595d
runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (#14162)
Commit: https://github.com/vim/vim/commit/62b26040eb4b6752be2c46852e8986083737a1bb
Author: dkearns <dougkearns@gmail.com>
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 <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 09 Mar 2024 17:45:03 +0100 |
parents | |
children | 4cad34137ea0 |
comparison
equal
deleted
inserted
replaced
34509:89bc200aeb24 | 34510:408e9818595d |
---|---|
1 " Vim :menu commands | |
2 | |
3 " :help disable menus | |
4 menu disable &File.&Open\.\.\. | |
5 amenu enable * | |
6 amenu disable &Tools.* | |
7 | |
8 | |
9 " :help menu-examples | |
10 nmenu Words.Add\ Var wb"zye:menu! Words.<C-R>z <C-R>z<CR> | |
11 nmenu Words.Remove\ Var wb"zye:unmenu! Words.<C-R>z<CR> | |
12 vmenu Words.Add\ Var "zy:menu! Words.<C-R>z <C-R>z <CR> | |
13 vmenu Words.Remove\ Var "zy:unmenu! Words.<C-R>z<CR> | |
14 imenu Words.Add\ Var <Esc>wb"zye:menu! Words.<C-R>z <C-R>z<CR>a | |
15 imenu Words.Remove\ Var <Esc>wb"zye:unmenu! Words.<C-R>z<CR>a | |
16 | |
17 | |
18 " special keys | |
19 menu <silent> &Foo\ bar :echo "Foobar"<CR> | |
20 menu <special> &Foo\ bar :echo "Foobar"<CR> | |
21 menu <script> &Foo\ bar :echo "Foobar"<CR> | |
22 menu <silent> <special> &Foo\ bar :echo "Foobar"<CR> | |
23 menu <silent> <special> <script> &Foo\ bar :echo "Foobar"<CR> | |
24 | |
25 | |
26 function Foo() | |
27 menu <silent> &Foo\ bar :echo "Foobar"<CR> | |
28 endfunction | |
29 | |
30 | |
31 " Example: runtime/menu.vim (modified) | |
32 an <silent> 10.330 &File.&Close<Tab>:close :confirm close<CR> | |
33 | |
34 an <silent> 10.330 &File.&Close<Tab>:close | |
35 \ :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> | |
36 \ confirm enew <Bar> | |
37 \ else <Bar> | |
38 \ confirm close <Bar> | |
39 \ endif<CR> | |
40 | |
41 an <silent> 10.330 &File.&Close<Tab>:close | |
42 "\ comment | |
43 \ :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> | |
44 "\ comment | |
45 \ confirm enew <Bar> | |
46 "\ comment | |
47 \ else <Bar> | |
48 "\ comment | |
49 \ confirm close <Bar> | |
50 "\ comment | |
51 \ endif<CR> | |
52 | |
53 an <silent> 10.330 &File.&Close<Tab>:close :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> | |
54 \ confirm enew <Bar> | |
55 \ else <Bar> | |
56 \ confirm close <Bar> | |
57 \ endif<CR> | |
58 | |
59 an <silent> 10.330 &File.&Close<Tab>:close :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> | |
60 "\ comment | |
61 \ confirm enew <Bar> | |
62 "\ comment | |
63 \ else <Bar> | |
64 "\ comment | |
65 \ confirm close <Bar> | |
66 "\ comment | |
67 \ endif<CR> | |
68 | |
69 | |
70 " popup menus | |
71 popup &Foo | echo "Foo" | |
72 popup! &Foo | echo "Foo" | |
73 |