From 2c7ed420d93fdefe5734f2e9cf6b863119d412f3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 29 Oct 2018 23:38:41 +0100 Subject: vim-patch:fc65cabb15d0 Update runtime files. https://github.com/vim/vim/commit/fc65cabb15d0236bce001ad78e12a40511caf941 --- vim-patch:8.0.1279: initializing menus can be slow Problem: Initializing menus can be slow, especially when there are many keymaps, color schemes, etc. Solution: Do the globbing for runtime files lazlily. (Ken Takata) --- runtime/menu.vim | 202 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 133 insertions(+), 69 deletions(-) (limited to 'runtime/menu.vim') diff --git a/runtime/menu.vim b/runtime/menu.vim index e9734d7cd0..5e4bd1f11b 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -2,7 +2,7 @@ " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar -" Last Change: 2017 Mar 04 +" Last Change: 2018 May 17 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. @@ -56,6 +56,13 @@ if exists("v:lang") || &langmenu != "" let s:lang = substitute(s:lang, '\.[^.]*', "", "") exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim" + if !exists("did_menu_trans") && s:lang =~ '_' + " If the language includes a region try matching without that region. + " (e.g. find menu_de.vim if s:lang == de_DE). + let langonly = substitute(s:lang, '_.*', "", "") + exe "runtime! lang/menu_" . langonly . "[^a-z]*vim" + endif + if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us' " On windows locale names are complicated, try using $LANG, it might " have been set by set_init_1(). But don't do this for "en" or "en_us". @@ -159,7 +166,7 @@ nnoremenu 20.370 &Edit.Put\ &Before[p [p inoremenu &Edit.Put\ &Before[p [p nnoremenu 20.380 &Edit.Put\ &After]p ]p inoremenu &Edit.Put\ &After]p ]p -if has("win32") || has("win16") +if has("win32") vnoremenu 20.390 &Edit.&Deletex x endif noremenu