summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0487
blob: e373db8b0992687b57fa59a77927478a5fc2d57b (plain)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
To: vim_dev@googlegroups.com
Subject: Patch 8.1.04
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.0487
Problem:    No menus specifically for the terminal window.
Solution:   Add :tlmenu. (Yee Cheng Chin, closes #3439) Add a menu test.
Files:	    runtime/delmenu.vim, runtime/doc/autocmd.txt, runtime/doc/gui.txt,
	    runtime/doc/index.txt, runtime/doc/terminal.txt,
	    runtime/doc/usr_42.txt, runtime/menu.vim, src/ex_cmdidxs.h,
	    src/ex_cmds.h, src/ex_docmd.c, src/menu.c, src/proto/menu.pro,
	    src/popupmnu.c, src/structs.h, src/testdir/test_menu.vim


*** ../vim-8.1.0486/runtime/delmenu.vim	2010-05-15 13:03:31.000000000 +0200
--- runtime/delmenu.vim	2018-10-19 18:35:52.654453150 +0200
***************
*** 5,10 ****
--- 5,11 ----
  " Last Change:	2001 May 27
  
  aunmenu *
+ tlunmenu *
  
  silent! unlet did_install_default_menus
  silent! unlet did_install_syntax_menu
*** ../vim-8.1.0486/runtime/doc/autocmd.txt	2018-09-16 15:47:45.629425398 +0200
--- runtime/doc/autocmd.txt	2018-10-19 18:35:52.654453150 +0200
***************
*** 831,843 ****
  				right mouse button).  Useful for adjusting the
  				menu for what is under the cursor or mouse
  				pointer.
! 				The pattern is matched against a single
! 				character representing the mode:
  					n	Normal
  					v	Visual
  					o	Operator-pending
  					i	Insert
  					c	Command line
  							*OptionSet*
  OptionSet			After setting an option.  The pattern is
  				matched against the long option name.
--- 835,848 ----
  				right mouse button).  Useful for adjusting the
  				menu for what is under the cursor or mouse
  				pointer.
! 				The pattern is matched against one or two
! 				characters representing the mode:
  					n	Normal
  					v	Visual
  					o	Operator-pending
  					i	Insert
  					c	Command line
+ 					tl	Terminal
  							*OptionSet*
  OptionSet			After setting an option.  The pattern is
  				matched against the long option name.
*** ../vim-8.1.0486/runtime/doc/gui.txt	2018-05-17 13:41:40.000000000 +0200
--- runtime/doc/gui.txt	2018-10-19 19:21:48.080078320 +0200
***************
*** 547,561 ****
  
  5.2 Creating New Menus					*creating-menus*
  
! 				*:me*  *:menu*  *:noreme*  *:noremenu*
! 				*:am*  *:amenu* *:an*      *:anoremenu*
! 				*:nme* *:nmenu* *:nnoreme* *:nnoremenu*
! 				*:ome* *:omenu* *:onoreme* *:onoremenu*
! 				*:vme* *:vmenu* *:vnoreme* *:vnoremenu*
! 				*:xme* *:xmenu* *:xnoreme* *:xnoremenu*
! 				*:sme* *:smenu* *:snoreme* *:snoremenu*
! 				*:ime* *:imenu* *:inoreme* *:inoremenu*
! 				*:cme* *:cmenu* *:cnoreme* *:cnoremenu*
  				*E330* *E327* *E331* *E336* *E333*
  				*E328* *E329* *E337* *E792*
  To create a new menu item, use the ":menu" commands.  They are mostly like
--- 547,562 ----
  
  5.2 Creating New Menus					*creating-menus*
  
! 				*:me*  *:menu*   *:noreme*  *:noremenu*
! 				*:am*  *:amenu*  *:an*      *:anoremenu*
! 				*:nme* *:nmenu*  *:nnoreme* *:nnoremenu*
! 				*:ome* *:omenu*  *:onoreme* *:onoremenu*
! 				*:vme* *:vmenu*  *:vnoreme* *:vnoremenu*
! 				*:xme* *:xmenu*  *:xnoreme* *:xnoremenu*
! 				*:sme* *:smenu*  *:snoreme* *:snoremenu*
! 				*:ime* *:imenu*  *:inoreme* *:inoremenu*
! 				*:cme* *:cmenu*  *:cnoreme* *:cnoremenu*
! 				*:tlm* *:tlmenu* *:tln*     *:tlnoremenu*
  				*E330* *E327* *E331* *E336* *E333*
  				*E328* *E329* *E337* *E792*
  To create a new menu item, use the ":menu" commands.  They are mostly like
***************
*** 571,576 ****
--- 572,581 ----
  "Big Changes", which is a sub-menu containing the item "Delete All Spaces",
  which when selected, performs the operation.
  
+ To create a menu for terminal mode, use |:tlmenu| instead of |:tmenu| unlike
+ key mapping (|:tmap|). This is because |:tmenu| is already used for defining
+ tooltips for menus. See |terminal-typing|.
+ 
  Special characters in a menu name:
  
  	&	The next character is the shortcut key.  Make sure each
***************
*** 589,597 ****
  this menu can be used.  The second part is shown as "Open     :e".  The ":e"
  is right aligned, and the "O" is underlined, to indicate it is the shortcut.
  
! The ":amenu" command can be used to define menu entries for all modes at once.
! To make the command work correctly, a character is automatically inserted for
! some modes:
  	mode		inserted	appended	~
  	Normal		nothing		nothing
  	Visual		<C-C>		<C-\><C-G>
--- 594,602 ----
  this menu can be used.  The second part is shown as "Open     :e".  The ":e"
  is right aligned, and the "O" is underlined, to indicate it is the shortcut.
  
! The ":amenu" command can be used to define menu entries for all modes at once,
! except for Terminal mode.  To make the command work correctly, a character is
! automatically inserted for some modes:
  	mode		inserted	appended	~
  	Normal		nothing		nothing
  	Visual		<C-C>		<C-\><C-G>
***************
*** 865,870 ****
--- 870,885 ----
  				insert-mode menu Eg: >
  	:emenu File.Exit
  
+ :[range]em[enu] {mode} {menu}	Like above, but execute the menu for {mode}:
+ 				    'n': |:nmenu|  Normal mode
+ 				    'v': |:vmenu|  Visual mode
+ 				    's': |:smenu|  Select mode
+ 				    'o': |:omenu|  Operator-pending mode
+ 				    't': |:tlmenu| Terminal mode
+ 				    'i': |:imenu|  Insert mode
+ 				    'c': |:cmenu|  Cmdline mode
+ 				
+ 
  If the console-mode vim has been compiled with WANT_MENU defined, you can
  use :emenu to access useful menu items you may have got used to from GUI
  mode.  See 'wildmenu' for an option that works well with this.  See
***************
*** 885,890 ****
--- 900,906 ----
  						*:sunme* *:sunmenu*
  						*:iunme* *:iunmenu*
  						*:cunme* *:cunmenu*
+ 						*:tlu*   *:tlunmenu*
  To delete a menu item or a whole submenu, use the unmenu commands, which are
  analogous to the unmap commands.  Eg: >
      :unmenu! Edit.Paste
***************
*** 951,956 ****
--- 967,974 ----
  :tu[nmenu] {menupath}		Remove a tip for a menu or tool.
  				{only in X11 and Win32 GUI}
  
+ Note: To create menus for terminal mode, use |:tlmenu| instead.
+ 
  When a tip is defined for a menu item, it appears in the command-line area
  when the mouse is over that item, much like a standard Windows menu hint in
  the status bar.  (Except when Vim is in Command-line mode, when of course
***************
*** 999,1005 ****
  				pointer instead of the cursor.
  				In the terminal this is the last known
  				position, which is usually at the last click
! 				or release (mouse movement is irrelevalt).
  
  Example: >
  	:popup File
--- 1017,1023 ----
  				pointer instead of the cursor.
  				In the terminal this is the last known
  				position, which is usually at the last click
! 				or release (mouse movement is irrelevant).
  
  Example: >
  	:popup File
***************
*** 1075,1078 ****
  For the Win32 GUI the external commands are executed in a separate window.
  See |gui-shell-win32|.
  
!  vim:tw=78:sw=4:ts=8:ft=help:norl:
--- 1093,1096 ----
  For the Win32 GUI the external commands are executed in a separate window.
  See |gui-shell-win32|.
  
!  vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
*** ../vim-8.1.0486/runtime/doc/index.txt	2018-05-17 13:41:41.000000000 +0200
--- runtime/doc/index.txt	2018-10-19 18:35:52.654453150 +0200
***************
*** 1583,1588 ****
--- 1583,1591 ----
  |:tjump|	:tj[ump]	like ":tselect", but jump directly when there
  				is only one match
  |:tlast|	:tl[ast]	jump to last matching tag
+ |:tlmenu|	:tlm[enu]	add menu for Terminal-Job mode
+ |:tlnoremenu|	:tln[oremenu]	like ":noremenu" but for Terminal-Job mode
+ |:tlunmenu|	:tlu[nmenu]	remove menu for Terminal-Job mode
  |:tmapclear|	:tmapc[lear]	remove all mappings for Terminal-Job mode
  |:tmap|		:tma[p]		like ":map" but for Terminal-Job mode
  |:tmenu|	:tm[enu]	define menu tooltip
***************
*** 1657,1660 ****
  |:~|		:~		repeat last ":substitute"
  
  
!  vim:tw=78:ts=8:ft=help:norl:
--- 1660,1663 ----
  |:~|		:~		repeat last ":substitute"
  
  
!  vim:tw=78:ts=8:noet:ft=help:norl:
*** ../vim-8.1.0486/runtime/doc/terminal.txt	2018-06-19 16:59:31.333713053 +0200
--- runtime/doc/terminal.txt	2018-10-19 18:35:52.658453120 +0200
***************
*** 114,119 ****
--- 114,122 ----
     tnoremap <Esc> <C-W>N
     set notimeout ttimeout timeoutlen=100
  
+ You can also create menus similar to terminal mode mappings, but you have to
+ use |:tlmenu| instead of |:tmenu|.
+ 
  <							*options-in-terminal*
  After opening the terminal window and setting 'buftype' to "terminal" the
  TerminalOpen autocommand event is triggered.  This makes it possible to set
***************
*** 228,233 ****
--- 231,240 ----
  
  			If you want to use more options use the |term_start()|
  			function.
+ 			If you want to split the window vertically, use: >
+ 				:vertical terminal
+ <			Or short: >
+ 				:vert ter
  
  When the buffer associated with the terminal is forcibly unloaded or wiped out
  the job is killed, similar to calling `job_stop(job, "kill")` .
***************
*** 523,531 ****
  
  Functions ~
  
! term_sendkeys()		send keystrokes to a terminal (not subject to tmap)
! term_wait()		wait for screen to be updated
! term_scrape()		inspect terminal screen
  
  
  ==============================================================================
--- 530,538 ----
  
  Functions ~
  
! |term_sendkeys()|	send keystrokes to a terminal (not subject to tmap)
! |term_wait()|		wait for screen to be updated
! |term_scrape()|		inspect terminal screen
  
  
  ==============================================================================
***************
*** 552,558 ****
    characters.  This makes sure the dump is always this size.  The function
    RunVimInTerminal() takes care of this.  Pass it the arguments for the Vim
    command.
! - Send any commands to Vim using term_sendkeys().  For example: >
  	call term_sendkeys(buf, ":echo &lines &columns\<CR>")
  - Check that the screen is now in the expected state, using
    VerifyScreenDump().  This expects the reference screen dump to be in the
--- 559,565 ----
    characters.  This makes sure the dump is always this size.  The function
    RunVimInTerminal() takes care of this.  Pass it the arguments for the Vim
    command.
! - Send any commands to Vim using |term_sendkeys()|.  For example: >
  	call term_sendkeys(buf, ":echo &lines &columns\<CR>")
  - Check that the screen is now in the expected state, using
    VerifyScreenDump().  This expects the reference screen dump to be in the
***************
*** 580,592 ****
  							*terminal-screendump*
  
  To create the screen dump, run Vim (or any other program) in a terminal and
! make it show the desired state.  Then use the term_dumpwrite() function to
  create a screen dump file.  For example: >
  	:call term_dumpwrite(77, "mysyntax.dump")
  
  Here "77" is the buffer number of the terminal.  Use `:ls!` to see it.
  
! You can view the screen dump with term_dumpload(): >
  	:call term_dumpload("mysyntax.dump")
  
  To verify that Vim still shows exactly the same screen, run Vim again with
--- 587,599 ----
  							*terminal-screendump*
  
  To create the screen dump, run Vim (or any other program) in a terminal and
! make it show the desired state.  Then use the |term_dumpwrite()| function to
  create a screen dump file.  For example: >
  	:call term_dumpwrite(77, "mysyntax.dump")
  
  Here "77" is the buffer number of the terminal.  Use `:ls!` to see it.
  
! You can view the screen dump with |term_dumpload()|: >
  	:call term_dumpload("mysyntax.dump")
  
  To verify that Vim still shows exactly the same screen, run Vim again with
***************
*** 594,600 ****
  again, using a different file name: >
  	:call term_dumpwrite(88, "test.dump")
  
! To assert that the files are exactly the same use assert_equalfile(): >
  	call assert_equalfile("mysyntax.dump", "test.dump")
  
  If there are differences then v:errors will contain the error message.
--- 601,607 ----
  again, using a different file name: >
  	:call term_dumpwrite(88, "test.dump")
  
! To assert that the files are exactly the same use |assert_equalfile()|: >
  	call assert_equalfile("mysyntax.dump", "test.dump")
  
  If there are differences then v:errors will contain the error message.
***************
*** 603,610 ****
  Comparing screen dumps ~
  						*terminal-diffscreendump*
  
! assert_equalfile() does not make it easy to see what is different.
! To spot the problem use term_dumpdiff(): >
  	call term_dumpdiff("mysyntax.dump", "test.dump")
  
  This will open a window consisting of three parts:
--- 610,617 ----
  Comparing screen dumps ~
  						*terminal-diffscreendump*
  
! |assert_equalfile()| does not make it easy to see what is different.
! To spot the problem use |term_dumpdiff()|: >
  	call term_dumpdiff("mysyntax.dump", "test.dump")
  
  This will open a window consisting of three parts:
***************
*** 613,619 ****
  3.  The contents of the second dump
  
  You can usually see what differs in the second part.  Use the 'ruler' to
! relate it to the position in the first or second dump.
  
  Alternatively, press "s" to swap the first and second dump. Do this several
  times so that you can spot the difference in the context of the text.
--- 620,637 ----
  3.  The contents of the second dump
  
  You can usually see what differs in the second part.  Use the 'ruler' to
! relate it to the position in the first or second dump.  Letters indicate the
! kind of difference:
! 	X	different character
! 	>	cursor in first but not in second
! 	<	cursor in second but not in first
! 	w	character width differs (single vs double width)
! 	f	foreground color differs
! 	b	background color differs
! 	a	attribute differs (bold, underline, reverse, etc.)
! 	?	character missing in both
! 	+	character missing in first
! 	-	character missing in second
  
  Alternatively, press "s" to swap the first and second dump. Do this several
  times so that you can spot the difference in the context of the text.
***************
*** 635,641 ****
  Load the plugin with this command: >
  	packadd termdebug
  <							*:Termdebug*
! To start debugging use `:Termdebug` or `:TermdebugCommand`` followed by the
  command name, for example: >
  	:Termdebug vim
  
--- 653,659 ----
  Load the plugin with this command: >
  	packadd termdebug
  <							*:Termdebug*
! To start debugging use `:Termdebug` or `:TermdebugCommand` followed by the
  command name, for example: >
  	:Termdebug vim
  
***************
*** 900,906 ****
  To change the width of the Vim window when debugging starts, and use a
  vertical split: >
    let g:termdebug_wide = 163
! This will set &columns to 163 when :Termdebug is used.  The value is restored
  when quitting the debugger.
  If g:termdebug_wide is set and &columns is already larger than
  g:termdebug_wide then a vertical split will be used without changing &columns.
--- 918,924 ----
  To change the width of the Vim window when debugging starts, and use a
  vertical split: >
    let g:termdebug_wide = 163
! This will set &columns to 163 when `:Termdebug` is used.  The value is restored
  when quitting the debugger.
  If g:termdebug_wide is set and &columns is already larger than
  g:termdebug_wide then a vertical split will be used without changing &columns.
***************
*** 909,912 ****
  
  
  
!  vim:tw=78:ts=8:ft=help:norl:
--- 927,930 ----
  
  
  
!  vim:tw=78:ts=8:noet:ft=help:norl:
*** ../vim-8.1.0486/runtime/doc/usr_42.txt	2018-05-17 13:42:03.000000000 +0200
--- runtime/doc/usr_42.txt	2018-10-19 18:35:52.658453120 +0200
***************
*** 150,156 ****
  	:menu!		Insert and Command-line mode
  	:imenu		Insert mode
  	:cmenu		Command-line mode
! 	:amenu		All modes
  
  To avoid that the commands of a menu item are being mapped, use the command
  ":noremenu", ":nnoremenu", ":anoremenu", etc.
--- 150,157 ----
  	:menu!		Insert and Command-line mode
  	:imenu		Insert mode
  	:cmenu		Command-line mode
! 	:tlmenu		Terminal mode
! 	:amenu		All modes (except for Terminal mode)
  
  To avoid that the commands of a menu item are being mapped, use the command
  ":noremenu", ":nnoremenu", ":anoremenu", etc.
***************
*** 362,365 ****
  
  Next chapter: |usr_43.txt|  Using filetypes
  
! Copyright: see |manual-copyright|  vim:tw=78:ts=8:ft=help:norl:
--- 363,366 ----
  
  Next chapter: |usr_43.txt|  Using filetypes
  
! Copyright: see |manual-copyright|  vim:tw=78:ts=8:noet:ft=help:norl:
*** ../vim-8.1.0486/runtime/menu.vim	2018-07-23 05:09:05.593235641 +0200
--- runtime/menu.vim	2018-10-19 22:31:52.955188961 +0200
***************
*** 160,165 ****
--- 160,168 ----
  cnoremenu 20.350 &Edit.&Copy<Tab>"+y		<C-Y>
  nnoremenu 20.360 &Edit.&Paste<Tab>"+gP		"+gP
  cnoremenu	 &Edit.&Paste<Tab>"+gP		<C-R>+
+ if exists(':tlmenu')
+   tlnoremenu	 &Edit.&Paste<Tab>"+gP		<C-W>"+
+ endif
  exe 'vnoremenu <script> &Edit.&Paste<Tab>"+gP	' . paste#paste_cmd['v']
  exe 'inoremenu <script> &Edit.&Paste<Tab>"+gP	' . paste#paste_cmd['i']
  nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p	[p
***************
*** 356,361 ****
--- 359,366 ----
    let s:did_setup_color_schemes = 1
  
    let n = globpath(&runtimepath, "colors/*.vim", 1, 1)
+   let n += globpath(&runtimepath, "pack/*/start/*/colors/*.vim", 1, 1)
+   let n += globpath(&runtimepath, "pack/*/opt/*/colors/*.vim", 1, 1)
  
    " Ignore case for VMS and windows, sort on name
    let names = sort(map(n, 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
*** ../vim-8.1.0486/src/ex_cmdidxs.h	2017-09-18 22:06:03.000000000 +0200
--- src/ex_cmdidxs.h	2018-10-19 18:35:52.658453120 +0200
***************
*** 25,36 ****
    /* r */ 351,
    /* s */ 370,
    /* t */ 437,
!   /* u */ 477,
!   /* v */ 488,
!   /* w */ 506,
!   /* x */ 521,
!   /* y */ 530,
!   /* z */ 531
  };
  
  /*
--- 25,36 ----
    /* r */ 351,
    /* s */ 370,
    /* t */ 437,
!   /* u */ 480,
!   /* v */ 491,
!   /* w */ 509,
!   /* x */ 524,
!   /* y */ 533,
!   /* z */ 534
  };
  
  /*
***************
*** 60,66 ****
    /* q */ {  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
    /* r */ {  0,  0,  0,  0,  0,  0,  0,  0, 11,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 13, 18,  0,  0,  0,  0 },
    /* s */ {  2,  6, 15,  0, 18, 22,  0, 24, 25,  0,  0, 28, 30, 34, 38, 40,  0, 48,  0, 49,  0, 61, 62,  0, 63,  0 },
!   /* t */ {  2,  0, 19,  0, 22, 24,  0, 25,  0, 26,  0, 27, 28, 31, 33, 34,  0, 35, 37,  0, 38,  0,  0,  0,  0,  0 },
    /* u */ {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 10,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
    /* v */ {  0,  0,  0,  0,  1,  0,  0,  0,  4,  0,  0,  0,  9, 12,  0,  0,  0,  0, 15,  0, 16,  0,  0,  0,  0,  0 },
    /* w */ {  2,  0,  0,  0,  0,  0,  0,  3,  4,  0,  0,  0,  0,  8,  0,  9, 10,  0, 12,  0, 13, 14,  0,  0,  0,  0 },
--- 60,66 ----
    /* q */ {  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
    /* r */ {  0,  0,  0,  0,  0,  0,  0,  0, 11,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 13, 18,  0,  0,  0,  0 },
    /* s */ {  2,  6, 15,  0, 18, 22,  0, 24, 25,  0,  0, 28, 30, 34, 38, 40,  0, 48,  0, 49,  0, 61, 62,  0, 63,  0 },
!   /* t */ {  2,  0, 19,  0, 22, 24,  0, 25,  0, 26,  0, 27, 31, 34, 36, 37,  0, 38, 40,  0, 41,  0,  0,  0,  0,  0 },
    /* u */ {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 10,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
    /* v */ {  0,  0,  0,  0,  1,  0,  0,  0,  4,  0,  0,  0,  9, 12,  0,  0,  0,  0, 15,  0, 16,  0,  0,  0,  0,  0 },
    /* w */ {  2,  0,  0,  0,  0,  0,  0,  3,  4,  0,  0,  0,  0,  8,  0,  9, 10,  0, 12,  0, 13, 14,  0,  0,  0,  0 },
***************
*** 69,72 ****
    /* z */ {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 }
  };
  
! static const int command_count = 544;
--- 69,72 ----
    /* z */ {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 }
  };
  
! static const int command_count = 547;
*** ../vim-8.1.0486/src/ex_cmds.h	2018-08-14 13:38:12.744559267 +0200
--- src/ex_cmds.h	2018-10-19 18:35:52.658453120 +0200
***************
*** 20,28 ****
   * 1. Add an entry in the table below.  Keep it sorted on the shortest
   *    version of the command name that works.  If it doesn't start with a
   *    lower case letter, add it at the end.
!  * 2. Add a "case: CMD_xxx" in the big switch in ex_docmd.c.
!  * 3. Add an entry in the index for Ex commands at ":help ex-cmd-index".
!  * 4. Add documentation in ../doc/xxx.txt.  Add a tag for both the short and
   *    long name of the command.
   */
  
--- 20,29 ----
   * 1. Add an entry in the table below.  Keep it sorted on the shortest
   *    version of the command name that works.  If it doesn't start with a
   *    lower case letter, add it at the end.
!  * 2. Run "make cmdidxs" to re-generate ex_cmdidxs.h.
!  * 3. Add a "case: CMD_xxx" in the big switch in ex_docmd.c.
!  * 4. Add an entry in the index for Ex commands at ":help ex-cmd-index".
!  * 5. Add documentation in ../doc/xxx.txt.  Add a tag for both the short and
   *    long name of the command.
   */
  
***************
*** 176,182 ****
  			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
  			ADDR_BUFFERS),
  EX(CMD_behave,		"behave",	ex_behave,
! 			NEEDARG|WORD1|TRLBAR|CMDWIN,
  			ADDR_LINES),
  EX(CMD_belowright,	"belowright",	ex_wrongmodifier,
  			NEEDARG|EXTRA|NOTRLCOM,
--- 177,183 ----
  			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
  			ADDR_BUFFERS),
  EX(CMD_behave,		"behave",	ex_behave,
! 			BANG|NEEDARG|WORD1|TRLBAR|CMDWIN,
  			ADDR_LINES),
  EX(CMD_belowright,	"belowright",	ex_wrongmodifier,
  			NEEDARG|EXTRA|NOTRLCOM,
***************
*** 1498,1503 ****
--- 1499,1513 ----
  EX(CMD_tlast,		"tlast",	ex_tag,
  			BANG|TRLBAR,
  			ADDR_LINES),
+ EX(CMD_tlmenu,		"tlmenu",	ex_menu,
+ 			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ 			ADDR_LINES),
+ EX(CMD_tlnoremenu,	"tlnoremenu",	ex_menu,
+ 			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ 			ADDR_LINES),
+ EX(CMD_tlunmenu,	"tlunmenu",	ex_menu,
+ 			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+ 			ADDR_LINES),
  EX(CMD_tmenu,		"tmenu",	ex_menu,
  			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
  			ADDR_LINES),
*** ../vim-8.1.0486/src/ex_docmd.c	2018-10-02 16:23:55.323037143 +0200
--- src/ex_docmd.c	2018-10-19 18:35:52.658453120 +0200
***************
*** 4283,4288 ****
--- 4283,4289 ----
  	case CMD_omenu:	    case CMD_onoremenu:	    case CMD_ounmenu:
  	case CMD_imenu:	    case CMD_inoremenu:	    case CMD_iunmenu:
  	case CMD_cmenu:	    case CMD_cnoremenu:	    case CMD_cunmenu:
+ 	case CMD_tlmenu:    case CMD_tlnoremenu:    case CMD_tlunmenu:
  	case CMD_tmenu:				    case CMD_tunmenu:
  	case CMD_popup:	    case CMD_tearoff:	    case CMD_emenu:
  	    return set_context_in_menu_cmd(xp, cmd, arg, forceit);
*** ../vim-8.1.0486/src/menu.c	2018-09-10 21:04:09.872392623 +0200
--- src/menu.c	2018-10-19 19:18:38.677792759 +0200
***************
*** 58,64 ****
  static char_u *menu_translate_tab_and_shift(char_u *arg_start);
  
  /* The character for each menu mode */
! static char_u	menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'};
  
  static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
  static char_u e_othermode[] = N_("E328: Menu only exists in another mode");
--- 58,64 ----
  static char_u *menu_translate_tab_and_shift(char_u *arg_start);
  
  /* The character for each menu mode */
! static char *menu_mode_chars[] = {"n", "v", "s", "o", "i", "c", "tl", "t"};
  
  static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
  static char_u e_othermode[] = N_("E328: Menu only exists in another mode");
***************
*** 1196,1202 ****
  		    return;
  		for (i = 0; i < depth + 2; i++)
  		    MSG_PUTS("  ");
! 		msg_putchar(menu_mode_chars[bit]);
  		if (menu->noremap[bit] == REMAP_NONE)
  		    msg_putchar('*');
  		else if (menu->noremap[bit] == REMAP_SCRIPT)
--- 1196,1202 ----
  		    return;
  		for (i = 0; i < depth + 2; i++)
  		    MSG_PUTS("  ");
! 		msg_puts((char_u*)menu_mode_chars[bit]);
  		if (menu->noremap[bit] == REMAP_NONE)
  		    msg_putchar('*');
  		else if (menu->noremap[bit] == REMAP_SCRIPT)
***************
*** 1645,1650 ****
--- 1645,1656 ----
  	    modes = MENU_INSERT_MODE;
  	    break;
  	case 't':
+ 	    if (*cmd == 'l')            /* tlmenu, tlunmenu, tlnoremenu */
+ 	    {
+ 		modes = MENU_TERMINAL_MODE;
+ 		++cmd;
+ 		break;
+ 	    }
  	    modes = MENU_TIP_MODE;	/* tmenu */
  	    break;
  	case 'c':			/* cmenu */
***************
*** 1687,1698 ****
  {
      char_u	*p;
      int		len = (int)STRLEN(name);
  
!     p = vim_strnsave(name, len + 1);
      if (p != NULL)
      {
! 	mch_memmove(p + 6, p + 5, (size_t)(len - 4));
! 	p[5] = menu_mode_chars[idx];
      }
      return p;
  }
--- 1693,1710 ----
  {
      char_u	*p;
      int		len = (int)STRLEN(name);
+     char	*mode_chars = menu_mode_chars[idx];
+     int		mode_chars_len = (int)strlen(mode_chars);
+     int		i;
  
!     p = vim_strnsave(name, len + mode_chars_len);
      if (p != NULL)
      {
! 	mch_memmove(p + 5 + mode_chars_len, p + 5, (size_t)(len - 4));
! 	for (i = 0; i < mode_chars_len; ++i)
! 	{
! 	    p[5 + i] = menu_mode_chars[idx][i];
! 	}
      }
      return p;
  }
***************
*** 1712,1717 ****
--- 1724,1733 ----
  	idx = MENU_INDEX_INSERT;
      else if (state & CMDLINE)
  	idx = MENU_INDEX_CMDLINE;
+ #ifdef FEAT_TERMINAL
+     else if (term_use_loop())
+ 	idx = MENU_INDEX_TERMINAL;
+ #endif
      else if (VIsual_active)
      {
  	if (VIsual_select)
***************
*** 1872,1877 ****
--- 1888,1899 ----
      static int
  get_menu_mode(void)
  {
+ #ifdef FEAT_TERMINAL
+     if (term_use_loop())
+     {
+ 	return MENU_INDEX_TERMINAL;
+     }
+ #endif
      if (VIsual_active)
      {
  	if (VIsual_select)
***************
*** 1910,1932 ****
  show_popupmenu(void)
  {
      vimmenu_T	*menu;
!     int		mode;
  
!     mode = get_menu_mode();
!     if (mode == MENU_INDEX_INVALID)
  	return;
!     mode = menu_mode_chars[mode];
  
!     {
! 	char_u	    ename[2];
! 
! 	ename[0] = mode;
! 	ename[1] = NUL;
! 	apply_autocmds(EVENT_MENUPOPUP, ename, NULL, FALSE, curbuf);
!     }
  
      for (menu = root_menu; menu != NULL; menu = menu->next)
! 	if (STRNCMP("PopUp", menu->name, 5) == 0 && menu->name[5] == mode)
  	    break;
  
      /* Only show a popup when it is defined and has entries */
--- 1932,1951 ----
  show_popupmenu(void)
  {
      vimmenu_T	*menu;
!     int		menu_mode;
!     char*	mode;
!     int		mode_len;
  
!     menu_mode = get_menu_mode();
!     if (menu_mode == MENU_INDEX_INVALID)
  	return;
!     mode = menu_mode_chars[menu_mode];
!     mode_len = (int)strlen(mode);
  
!     apply_autocmds(EVENT_MENUPOPUP, (char_u*)mode, NULL, FALSE, curbuf);
  
      for (menu = root_menu; menu != NULL; menu = menu->next)
! 	if (STRNCMP("PopUp", menu->name, 5) == 0 && STRNCMP(menu->name + 5, mode, mode_len) == 0)
  	    break;
  
      /* Only show a popup when it is defined and has entries */
***************
*** 2249,2330 ****
  /*
   * Execute "menu".  Use by ":emenu" and the window toolbar.
   * "eap" is NULL for the window toolbar.
   */
      void
! execute_menu(exarg_T *eap, vimmenu_T *menu)
  {
!     char_u	*mode;
!     int		idx = -1;
  
!     /* Use the Insert mode entry when returning to Insert mode. */
!     if (restart_edit
  #ifdef FEAT_EVAL
! 	    && !current_sctx.sc_sid
  #endif
! 	    )
!     {
! 	mode = (char_u *)"Insert";
! 	idx = MENU_INDEX_INSERT;
!     }
!     else if (VIsual_active)
!     {
! 	mode = (char_u *)"Visual";
! 	idx = MENU_INDEX_VISUAL;
!     }
!     else if (eap != NULL && eap->addr_count)
!     {
! 	pos_T	tpos;
! 
! 	mode = (char_u *)"Visual";
! 	idx = MENU_INDEX_VISUAL;
! 
! 	/* GEDDES: This is not perfect - but it is a
! 	 * quick way of detecting whether we are doing this from a
! 	 * selection - see if the range matches up with the visual
! 	 * select start and end.  */
! 	if ((curbuf->b_visual.vi_start.lnum == eap->line1)
! 		&& (curbuf->b_visual.vi_end.lnum) == eap->line2)
! 	{
! 	    /* Set it up for visual mode - equivalent to gv.  */
! 	    VIsual_mode = curbuf->b_visual.vi_mode;
! 	    tpos = curbuf->b_visual.vi_end;
! 	    curwin->w_cursor = curbuf->b_visual.vi_start;
! 	    curwin->w_curswant = curbuf->b_visual.vi_curswant;
  	}
! 	else
  	{
! 	    /* Set it up for line-wise visual mode */
! 	    VIsual_mode = 'V';
! 	    curwin->w_cursor.lnum = eap->line1;
! 	    curwin->w_cursor.col = 1;
! 	    tpos.lnum = eap->line2;
! 	    tpos.col = MAXCOL;
! #ifdef FEAT_VIRTUALEDIT
! 	    tpos.coladd = 0;
  #endif
  	}
  
! 	/* Activate visual mode */
! 	VIsual_active = TRUE;
! 	VIsual_reselect = TRUE;
! 	check_cursor();
! 	VIsual = curwin->w_cursor;
! 	curwin->w_cursor = tpos;
  
! 	check_cursor();
  
! 	/* Adjust the cursor to make sure it is in the correct pos
! 	 * for exclusive mode */
! 	if (*p_sel == 'e' && gchar_cursor() != NUL)
! 	    ++curwin->w_cursor.col;
      }
  
      /* For the WinBar menu always use the Normal mode menu. */
      if (idx == -1 || eap == NULL)
-     {
- 	mode = (char_u *)"Normal";
  	idx = MENU_INDEX_NORMAL;
-     }
  
      if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL)
      {
--- 2268,2353 ----
  /*
   * Execute "menu".  Use by ":emenu" and the window toolbar.
   * "eap" is NULL for the window toolbar.
+  * "mode_idx" specifies a MENU_INDEX_ value, use -1 to depend on the current
+  * state.
   */
      void
! execute_menu(exarg_T *eap, vimmenu_T *menu, int mode_idx)
  {
!     int		idx = mode_idx;
  
!     if (idx < 0)
!     {
! 	/* Use the Insert mode entry when returning to Insert mode. */
! 	if (restart_edit
  #ifdef FEAT_EVAL
! 		&& !current_sctx.sc_sid
  #endif
! 		)
! 	{
! 	    idx = MENU_INDEX_INSERT;
  	}
! #ifdef FEAT_TERMINAL
! 	else if (term_use_loop())
  	{
! 	    idx = MENU_INDEX_TERMINAL;
! 	}
  #endif
+ 	else if (VIsual_active)
+ 	{
+ 	    idx = MENU_INDEX_VISUAL;
  	}
+ 	else if (eap != NULL && eap->addr_count)
+ 	{
+ 	    pos_T	tpos;
  
! 	    idx = MENU_INDEX_VISUAL;
  
! 	    /* GEDDES: This is not perfect - but it is a
! 	     * quick way of detecting whether we are doing this from a
! 	     * selection - see if the range matches up with the visual
! 	     * select start and end.  */
! 	    if ((curbuf->b_visual.vi_start.lnum == eap->line1)
! 		    && (curbuf->b_visual.vi_end.lnum) == eap->line2)
! 	    {
! 		/* Set it up for visual mode - equivalent to gv.  */
! 		VIsual_mode = curbuf->b_visual.vi_mode;
! 		tpos = curbuf->b_visual.vi_end;
! 		curwin->w_cursor = curbuf->b_visual.vi_start;
! 		curwin->w_curswant = curbuf->b_visual.vi_curswant;
! 	    }
! 	    else
! 	    {
! 		/* Set it up for line-wise visual mode */
! 		VIsual_mode = 'V';
! 		curwin->w_cursor.lnum = eap->line1;
! 		curwin->w_cursor.col = 1;
! 		tpos.lnum = eap->line2;
! 		tpos.col = MAXCOL;
! #ifdef FEAT_VIRTUALEDIT
! 		tpos.coladd = 0;
! #endif
! 	    }
  
! 	    /* Activate visual mode */
! 	    VIsual_active = TRUE;
! 	    VIsual_reselect = TRUE;
! 	    check_cursor();
! 	    VIsual = curwin->w_cursor;
! 	    curwin->w_cursor = tpos;
! 
! 	    check_cursor();
! 
! 	    /* Adjust the cursor to make sure it is in the correct pos
! 	     * for exclusive mode */
! 	    if (*p_sel == 'e' && gchar_cursor() != NUL)
! 		++curwin->w_cursor.col;
! 	}
      }
  
      /* For the WinBar menu always use the Normal mode menu. */
      if (idx == -1 || eap == NULL)
  	idx = MENU_INDEX_NORMAL;
  
      if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL)
      {
***************
*** 2351,2357 ****
--- 2374,2408 ----
  						     TRUE, menu->silent[idx]);
      }
      else if (eap != NULL)
+     {
+ 	char_u	*mode;
+ 
+ 	switch (idx)
+ 	{
+ 	    case MENU_INDEX_VISUAL:
+ 		mode = (char_u *)"Visual";
+ 		break;
+ 	    case MENU_INDEX_SELECT:
+ 		mode = (char_u *)"Select";
+ 		break;
+ 	    case MENU_INDEX_OP_PENDING:
+ 		mode = (char_u *)"Op-pending";
+ 		break;
+ 	    case MENU_INDEX_TERMINAL:
+ 		mode = (char_u *)"Terminal";
+ 		break;
+ 	    case MENU_INDEX_INSERT:
+ 		mode = (char_u *)"Insert";
+ 		break;
+ 	    case MENU_INDEX_CMDLINE:
+ 		mode = (char_u *)"Cmdline";
+ 		break;
+ 	    // case MENU_INDEX_TIP: cannot happen
+ 	    default:
+ 		mode = (char_u *)"Normal";
+ 	}
  	EMSG2(_("E335: Menu not defined for %s mode"), mode);
+     }
  }
  
  /*
***************
*** 2364,2372 ****
      vimmenu_T	*menu;
      char_u	*name;
      char_u	*saved_name;
      char_u	*p;
  
!     saved_name = vim_strsave(eap->arg);
      if (saved_name == NULL)
  	return;
  
--- 2415,2443 ----
      vimmenu_T	*menu;
      char_u	*name;
      char_u	*saved_name;
+     char_u	*arg = eap->arg;
      char_u	*p;
+     int		gave_emsg = FALSE;
+     int		mode_idx = -1;
+ 
+     if (arg[0] && VIM_ISWHITE(arg[1]))
+     {
+ 	switch (arg[0])
+ 	{
+ 	    case 'n': mode_idx = MENU_INDEX_NORMAL; break;
+ 	    case 'v': mode_idx = MENU_INDEX_VISUAL; break;
+ 	    case 's': mode_idx = MENU_INDEX_SELECT; break;
+ 	    case 'o': mode_idx = MENU_INDEX_OP_PENDING; break;
+ 	    case 't': mode_idx = MENU_INDEX_TERMINAL; break;
+ 	    case 'i': mode_idx = MENU_INDEX_INSERT; break;
+ 	    case 'c': mode_idx = MENU_INDEX_CMDLINE; break;
+ 	    default: EMSG2(_(e_invarg2), arg);
+ 		     return;
+ 	}
+ 	arg = skipwhite(arg + 2);
+     }
  
!     saved_name = vim_strsave(arg);
      if (saved_name == NULL)
  	return;
  
***************
*** 2384,2389 ****
--- 2455,2461 ----
  		if (*p == NUL && menu->children != NULL)
  		{
  		    EMSG(_("E333: Menu path must lead to a menu item"));
+ 		    gave_emsg = TRUE;
  		    menu = NULL;
  		}
  		else if (*p != NUL && menu->children == NULL)
***************
*** 2403,2414 ****
      vim_free(saved_name);
      if (menu == NULL)
      {
! 	EMSG2(_("E334: Menu not found: %s"), eap->arg);
  	return;
      }
  
!     /* Found the menu, so execute. */
!     execute_menu(eap, menu);
  }
  
  /*
--- 2475,2487 ----
      vim_free(saved_name);
      if (menu == NULL)
      {
! 	if (!gave_emsg)
! 	    EMSG2(_("E334: Menu not found: %s"), arg);
  	return;
      }
  
!     // Found the menu, so execute.
!     execute_menu(eap, menu, mode_idx);
  }
  
  /*
***************
*** 2445,2451 ****
  		check_cursor();
  	    }
  
! 	    execute_menu(NULL, item->wb_menu);
  
  	    if (save_curwin != NULL)
  	    {
--- 2518,2524 ----
  		check_cursor();
  	    }
  
! 	    execute_menu(NULL, item->wb_menu, -1);
  
  	    if (save_curwin != NULL)
  	    {
*** ../vim-8.1.0486/src/proto/menu.pro	2018-05-17 13:52:44.000000000 +0200
--- src/proto/menu.pro	2018-10-19 19:18:21.773946949 +0200
***************
*** 19,25 ****
  void gui_update_menus(int modes);
  int gui_is_menu_shortcut(int key);
  void gui_mch_toggle_tearoffs(int enable);
! void execute_menu(exarg_T *eap, vimmenu_T *menu);
  void ex_emenu(exarg_T *eap);
  void winbar_click(win_T *wp, int col);
  vimmenu_T *gui_find_menu(char_u *path_name);
--- 19,25 ----
  void gui_update_menus(int modes);
  int gui_is_menu_shortcut(int key);
  void gui_mch_toggle_tearoffs(int enable);
! void execute_menu(exarg_T *eap, vimmenu_T *menu, int mode_idx);
  void ex_emenu(exarg_T *eap);
  void winbar_click(win_T *wp, int col);
  vimmenu_T *gui_find_menu(char_u *path_name);
*** ../vim-8.1.0486/src/popupmnu.c	2018-09-09 15:27:54.808344790 +0200
--- src/popupmnu.c	2018-10-19 19:06:36.212711840 +0200
***************
*** 1176,1182 ****
  	if ((mp->modes & mp->enabled & mode) && idx++ == pum_selected)
  	{
  	    vim_memset(&ea, 0, sizeof(ea));
! 	    execute_menu(&ea, mp);
  	    break;
  	}
  }
--- 1176,1182 ----
  	if ((mp->modes & mp->enabled & mode) && idx++ == pum_selected)
  	{
  	    vim_memset(&ea, 0, sizeof(ea));
! 	    execute_menu(&ea, mp, -1);
  	    break;
  	}
  }
*** ../vim-8.1.0486/src/structs.h	2018-10-14 22:38:06.161665231 +0200
--- src/structs.h	2018-10-19 18:35:52.662453090 +0200
***************
*** 3101,3108 ****
  #define MENU_INDEX_OP_PENDING	3
  #define MENU_INDEX_INSERT	4
  #define MENU_INDEX_CMDLINE	5
! #define MENU_INDEX_TIP		6
! #define MENU_MODES		7
  
  /* Menu modes */
  #define MENU_NORMAL_MODE	(1 << MENU_INDEX_NORMAL)
--- 3101,3109 ----
  #define MENU_INDEX_OP_PENDING	3
  #define MENU_INDEX_INSERT	4
  #define MENU_INDEX_CMDLINE	5
! #define MENU_INDEX_TERMINAL	6
! #define MENU_INDEX_TIP		7
! #define MENU_MODES		8
  
  /* Menu modes */
  #define MENU_NORMAL_MODE	(1 << MENU_INDEX_NORMAL)
***************
*** 3111,3116 ****
--- 3112,3118 ----
  #define MENU_OP_PENDING_MODE	(1 << MENU_INDEX_OP_PENDING)
  #define MENU_INSERT_MODE	(1 << MENU_INDEX_INSERT)
  #define MENU_CMDLINE_MODE	(1 << MENU_INDEX_CMDLINE)
+ #define MENU_TERMINAL_MODE	(1 << MENU_INDEX_TERMINAL)
  #define MENU_TIP_MODE		(1 << MENU_INDEX_TIP)
  #define MENU_ALL_MODES		((1 << MENU_INDEX_TIP) - 1)
  /*note MENU_INDEX_TIP is not a 'real' mode*/
*** ../vim-8.1.0486/src/testdir/test_menu.vim	2017-03-18 20:09:29.000000000 +0100
--- src/testdir/test_menu.vim	2018-10-19 22:19:19.563500587 +0200
***************
*** 30,32 ****
--- 30,66 ----
  
    source $VIMRUNTIME/delmenu.vim
  endfunc
+ 
+ func Test_menu_commands()
+   nmenu 2 Test.FooBar :let g:did_menu = 'normal'<CR>
+   vmenu 2 Test.FooBar :let g:did_menu = 'visual'<CR>
+   smenu 2 Test.FooBar :let g:did_menu = 'select'<CR>
+   omenu 2 Test.FooBar :let g:did_menu = 'op-pending'<CR>
+   tlmenu 2 Test.FooBar :let g:did_menu = 'terminal'<CR>
+   imenu 2 Test.FooBar :let g:did_menu = 'insert'<CR>
+   cmenu 2 Test.FooBar :let g:did_menu = 'cmdline'<CR>
+   emenu n Test.FooBar
+   call assert_equal('normal', g:did_menu)
+   emenu v Test.FooBar
+   call assert_equal('visual', g:did_menu)
+   emenu s Test.FooBar
+   call assert_equal('select', g:did_menu)
+   emenu o Test.FooBar
+   call assert_equal('op-pending', g:did_menu)
+   emenu t Test.FooBar
+   call assert_equal('terminal', g:did_menu)
+   emenu i Test.FooBar
+   call assert_equal('insert', g:did_menu)
+   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>
+   call assert_fails('emenu n Test.FooBar', 'E333:')
+   nunmenu Test.FooBar.Child
+ 
+   unlet g:did_menu
+ endfun
*** ../vim-8.1.0486/src/version.c	2018-10-19 17:35:58.081200733 +0200
--- src/version.c	2018-10-19 18:36:44.394062760 +0200
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     487,
  /**/

-- 
"Women marry men hoping they will change. Men marry women hoping
they will not. So each is inevitably disappointed."
 - Einstein

 /// 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    ///