diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 07:39:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 07:40:16 +0000 |
commit | 6af24b2457752c0d36aaf9f29f03d39afd09937f (patch) | |
tree | 2671b594908d1f971de6b2a2d473f97dfb7291d2 /runtime/syntax/testdir/input/vim_ex_menu.vim | |
parent | Releasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff) | |
download | vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip |
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/testdir/input/vim_ex_menu.vim')
-rw-r--r-- | runtime/syntax/testdir/input/vim_ex_menu.vim | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/input/vim_ex_menu.vim b/runtime/syntax/testdir/input/vim_ex_menu.vim new file mode 100644 index 0000000..fb737c2 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_menu.vim @@ -0,0 +1,87 @@ +" 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.<C-R>z <C-R>z<CR> +nmenu Words.Remove\ Var wb"zye:unmenu! Words.<C-R>z<CR> +vmenu Words.Add\ Var "zy:menu! Words.<C-R>z <C-R>z <CR> +vmenu Words.Remove\ Var "zy:unmenu! Words.<C-R>z<CR> +imenu Words.Add\ Var <Esc>wb"zye:menu! Words.<C-R>z <C-R>z<CR>a +imenu Words.Remove\ Var <Esc>wb"zye:unmenu! Words.<C-R>z<CR>a + + +" special keys +menu <silent> &Foo\ bar :echo "Foobar"<CR> +menu <special> &Foo\ bar :echo "Foobar"<CR> +menu <script> &Foo\ bar :echo "Foobar"<CR> +menu <silent> <special> &Foo\ bar :echo "Foobar"<CR> +menu <silent> <special> <script> &Foo\ bar :echo "Foobar"<CR> + + +function Foo() + menu <silent> &Foo\ bar :echo "Foobar"<CR> +endfunction + + +" Example: runtime/menu.vim (modified) +an <silent> 10.330 &File.&Close<Tab>:close :confirm close<CR> + +an <silent> 10.330 &File.&Close<Tab>:close + \ :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> + \ confirm enew <Bar> + \ else <Bar> + \ confirm close <Bar> + \ endif<CR> + +an <silent> 10.330 &File.&Close<Tab>:close + "\ comment + \ :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> + "\ comment + \ confirm enew <Bar> + "\ comment + \ else <Bar> + "\ comment + \ confirm close <Bar> + "\ comment + \ endif<CR> + +an <silent> 10.330 &File.&Close<Tab>:close :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> + \ confirm enew <Bar> + \ else <Bar> + \ confirm close <Bar> + \ endif<CR> + +an <silent> 10.330 &File.&Close<Tab>:close :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar> + "\ comment + \ confirm enew <Bar> + "\ comment + \ else <Bar> + "\ comment + \ confirm close <Bar> + "\ comment + \ endif<CR> + + +" popup menus +popup &Foo | echo "Foo" +popup! &Foo | echo "Foo" + + +" Issue #14230 + +" a menu item name cannot start with '.' + +export def HistoryJumpMenu() + popup.FilterMenu("Jump history", dir_hist, + (res, _) => { + HistoryJump(res.text) + }) +enddef + +popup\.FilterMenu<Tab>Filter()<CR> + |