Skip to content

Commit 0b58aa1

Browse files
committed
Add terminal menu mappings for new tab/tab next/full screen menus
Vim terminals use tlmenu to specify menu items and the normal `amenu` doesn't work. This causes functionality such as toggling full screen and going to next/prev tab to not work in terminal mode. Fix that by adding the proper tlmenu mapping to the appropriate items. Fix #1045
1 parent 78a397a commit 0b58aa1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

runtime/menu.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ if has("gui_macvim")
8282
an <silent> 9998.310 Window.Zoom <Nop>
8383
an <silent> 9998.311 Window.Zoom\ All <Nop>
8484
an <silent> 9998.320 Window.Toggle\ Full\ Screen\ Mode :set invfullscreen<CR>
85+
tln <silent> 9998.320 Window.Toggle\ Full\ Screen\ Mode <C-W>:set invfullscreen<CR>
8586
an 9998.330 Window.-SEP1- <Nop>
8687
" TODO! Grey out if no tabs are visible.
8788
an <silent> 9998.340 Window.Select\ Next\ Tab :tabnext<CR>
89+
tln <silent> 9998.340 Window.Select\ Next\ Tab <C-W>:tabnext<CR>
8890
an <silent> 9998.350 Window.Select\ Previous\ Tab :tabprevious<CR>
91+
tln <silent> 9998.350 Window.Select\ Previous\ Tab <C-W>:tabprevious<CR>
8992
an 9998.360 Window.-SEP2- <Nop>
9093
an <silent> 9998.370 Window.Bring\ All\ To\ Front <Nop>
9194
an <silent> 9998.380 Window.Stay\ in\ Front <Nop>
@@ -130,10 +133,12 @@ endfun
130133
if has("gui_macvim")
131134
an <silent> 10.290 &File.New\ Window <Nop>
132135
an 10.295 &File.New\ Tab :tabnew<CR>
136+
tln 10.295 &File.New\ Tab <C-W>:tabnew<CR>
133137
an <silent> 10.310 &File.Open\.\.\. <Nop>
134138
an <silent> 10.325 &File.Open\ Recent <Nop>
135139
an 10.328 &File.-SEP0- <Nop>
136140
an <silent> 10.330 &File.Close\ Window<Tab>:qa :conf qa<CR>
141+
tln <silent> 10.330 &File.Close\ Window<Tab>:qa <C-W>:conf qa<CR>
137142
an <silent> 10.332 &File.Close :conf q<CR>
138143
an <silent> 10.341 &File.Save\ All :browse conf wa<CR>
139144
an 10.350 &File.Save\ As\.\.\.<Tab>:sav :browse confirm saveas<CR>
@@ -1328,20 +1333,25 @@ if has("touchbar")
13281333

13291334
if !exists("g:macvim_default_touchbar_fullscreen") || g:macvim_default_touchbar_fullscreen
13301335
an icon=NSTouchBarEnterFullScreenTemplate 1.10 TouchBar.EnterFullScreen :set fullscreen<CR>
1336+
tln icon=NSTouchBarEnterFullScreenTemplate 1.10 TouchBar.EnterFullScreen <C-W>:set fullscreen<CR>
13311337
endif
13321338

13331339
let s:touchbar_fullscreen=0
13341340
func! s:SetupFullScreenTouchBar()
13351341
if &fullscreen && s:touchbar_fullscreen != 1
13361342
silent! aun TouchBar.EnterFullScreen
1343+
silent! tlun TouchBar.EnterFullScreen
13371344
if !exists("g:macvim_default_touchbar_fullscreen") || g:macvim_default_touchbar_fullscreen
13381345
an icon=NSTouchBarExitFullScreenTemplate 1.10 TouchBar.ExitFullScreen :set nofullscreen<CR>
1346+
tln icon=NSTouchBarExitFullScreenTemplate 1.10 TouchBar.ExitFullScreen <C-W>:set nofullscreen<CR>
13391347
endif
13401348
let s:touchbar_fullscreen = 1
13411349
elseif !&fullscreen && s:touchbar_fullscreen != 0
13421350
silent! aun TouchBar.ExitFullScreen
1351+
silent! tlun TouchBar.ExitFullScreen
13431352
if !exists("g:macvim_default_touchbar_fullscreen") || g:macvim_default_touchbar_fullscreen
13441353
an icon=NSTouchBarEnterFullScreenTemplate 1.10 TouchBar.EnterFullScreen :set fullscreen<CR>
1354+
tln icon=NSTouchBarEnterFullScreenTemplate 1.10 TouchBar.EnterFullScreen <C-W>:set fullscreen<CR>
13451355
endif
13461356
let s:touchbar_fullscreen = 0
13471357
endif

0 commit comments

Comments
 (0)