1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1274
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.1274
Problem: After :unmenu can still execute the menu with :emenu.
Solution: Do not execute a menu that was disabled for the specified mode.
Files: src/menu.c, src/testdir/test_menu.vim
*** ../vim-8.1.1273/src/menu.c 2019-05-04 16:55:15.786921815 +0200
--- src/menu.c 2019-05-05 14:08:55.709800738 +0200
***************
*** 2337,2343 ****
if (idx == -1 || eap == NULL)
idx = MENU_INDEX_NORMAL;
! if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL)
{
/* When executing a script or function execute the commands right now.
* Also for the window toolbar.
--- 2337,2344 ----
if (idx == -1 || eap == NULL)
idx = MENU_INDEX_NORMAL;
! if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL
! && (menu->modes & (1 << idx)))
{
/* When executing a script or function execute the commands right now.
* Also for the window toolbar.
*** ../vim-8.1.1273/src/testdir/test_menu.vim 2018-10-19 22:35:04.889189955 +0200
--- src/testdir/test_menu.vim 2019-05-05 14:18:23.034607663 +0200
***************
*** 54,61 ****
emenu c Test.FooBar
call assert_equal('cmdline', g:did_menu)
! aunmenu Test.FooBar
tlunmenu Test.FooBar
call assert_fails('emenu n Test.FooBar', 'E334:')
nmenu 2 Test.FooBar.Child :let g:did_menu = 'foobar'<CR>
--- 54,76 ----
emenu c Test.FooBar
call assert_equal('cmdline', g:did_menu)
! nunmenu Test.FooBar
! call assert_fails('emenu n Test.FooBar', 'E335: Menu not defined for Normal mode')
! vunmenu Test.FooBar
! call assert_fails('emenu v Test.FooBar', 'E335: Menu not defined for Visual mode')
! vmenu 2 Test.FooBar :let g:did_menu = 'visual'<CR>
! sunmenu Test.FooBar
! call assert_fails('emenu s Test.FooBar', 'E335: Menu not defined for Select mode')
! ounmenu Test.FooBar
! call assert_fails('emenu o Test.FooBar', 'E335: Menu not defined for Op-pending mode')
! iunmenu Test.FooBar
! call assert_fails('emenu i Test.FooBar', 'E335: Menu not defined for Insert mode')
! cunmenu Test.FooBar
! call assert_fails('emenu c Test.FooBar', 'E335: Menu not defined for Cmdline mode')
tlunmenu Test.FooBar
+ call assert_fails('emenu t Test.FooBar', 'E335: Menu not defined for Terminal mode')
+
+ aunmenu Test.FooBar
call assert_fails('emenu n Test.FooBar', 'E334:')
nmenu 2 Test.FooBar.Child :let g:did_menu = 'foobar'<CR>
*** ../vim-8.1.1273/src/version.c 2019-05-05 13:19:59.322159435 +0200
--- src/version.c 2019-05-05 14:10:37.625221849 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1274,
/**/
--
ROBIN: (warily) And if you get a question wrong?
ARTHUR: You are cast into the Gorge of Eternal Peril.
ROBIN: Oh ... wacho!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|