diff --git a/runtime/menu.vim b/runtime/menu.vim index 81872bf554..5d8eb33f7f 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -1238,60 +1238,6 @@ enddef endif -endif " !exists("did_install_default_menus") - -" Define these items always, so that syntax can be switched on when it wasn't. -" But skip them when the Syntax menu was disabled by the user. -if !exists("did_install_syntax_menu") - an 50.212 &Syntax.&Manual :syn manual - an 50.214 &Syntax.A&utomatic :syn on - an 50.216 &Syntax.On/Off\ for\ &This\ File :call SynOnOff() - if !exists("*s:SynOnOff") - def s:SynOnOff() - if has("syntax_items") - syn clear - else - if !exists("g:syntax_on") - syn manual - endif - set syn=ON - endif - enddef - endif -endif - - -" Install the Syntax menu only when filetype.vim has been loaded or when -" manual syntax highlighting is enabled. -" Avoid installing the Syntax menu twice. -if (exists("did_load_filetypes") || exists("syntax_on")) - \ && !exists("did_install_syntax_menu") - let did_install_syntax_menu = 1 - -" Skip setting up the individual syntax selection menus unless -" do_syntax_sel_menu is defined (it takes quite a bit of time). -if exists("do_syntax_sel_menu") - runtime! synmenu.vim -else - an 50.10 &Syntax.&Show\ File\ Types\ in\ Menu :let do_syntax_sel_menu = 1runtime! synmenu.vimaunmenu &Syntax.&Show\ File\ Types\ in\ Menu - an 50.195 &Syntax.-SEP1- -endif - -an 50.210 &Syntax.&Off :syn off -an 50.700 &Syntax.-SEP3- -an 50.710 &Syntax.Co&lor\ Test :sp $VIMRUNTIME/syntax/colortest.vimso % -an 50.720 &Syntax.&Highlight\ Test :runtime syntax/hitest.vim -an 50.730 &Syntax.&Convert\ to\ HTML :runtime syntax/2html.vim - -" Uncomment the next line to compile the functions early to find any mistakes -" defcompile - -endif " !exists("did_install_syntax_menu") - -" Restore the previous value of 'cpoptions'. -let &cpo = s:cpo_save -unlet s:cpo_save - if has("gui_macvim") " @@ -1350,8 +1296,63 @@ if has("gui_macvim") macm Help.MacVim\ Help key= macm Help.MacVim\ Website action=openWebsite: +endif " if has("gui_macvim") + +endif " !exists("did_install_default_menus") + +" Define these items always, so that syntax can be switched on when it wasn't. +" But skip them when the Syntax menu was disabled by the user. +if !exists("did_install_syntax_menu") + an 50.212 &Syntax.&Manual :syn manual + an 50.214 &Syntax.A&utomatic :syn on + an 50.216 &Syntax.On/Off\ for\ &This\ File :call SynOnOff() + if !exists("*s:SynOnOff") + def s:SynOnOff() + if has("syntax_items") + syn clear + else + if !exists("g:syntax_on") + syn manual + endif + set syn=ON + endif + enddef + endif +endif + + +" Install the Syntax menu only when filetype.vim has been loaded or when +" manual syntax highlighting is enabled. +" Avoid installing the Syntax menu twice. +if (exists("did_load_filetypes") || exists("syntax_on")) + \ && !exists("did_install_syntax_menu") + let did_install_syntax_menu = 1 + +" Skip setting up the individual syntax selection menus unless +" do_syntax_sel_menu is defined (it takes quite a bit of time). +if exists("do_syntax_sel_menu") + runtime! synmenu.vim +else + an 50.10 &Syntax.&Show\ File\ Types\ in\ Menu :let do_syntax_sel_menu = 1runtime! synmenu.vimaunmenu &Syntax.&Show\ File\ Types\ in\ Menu + an 50.195 &Syntax.-SEP1- endif +an 50.210 &Syntax.&Off :syn off +an 50.700 &Syntax.-SEP3- +an 50.710 &Syntax.Co&lor\ Test :sp $VIMRUNTIME/syntax/colortest.vimso % +an 50.720 &Syntax.&Highlight\ Test :runtime syntax/hitest.vim +an 50.730 &Syntax.&Convert\ to\ HTML :runtime syntax/2html.vim + +" Uncomment the next line to compile the functions early to find any mistakes +" defcompile + +endif " !exists("did_install_syntax_menu") + +" Restore the previous value of 'cpoptions'. +let &cpo = s:cpo_save +unlet s:cpo_save + + if has("touchbar") " Set up default Touch Bar buttons. " 1. Smart fullscreen icon that toggles between going full screen or not.