aboutsummaryrefslogtreecommitdiff
path: root/runtime/menu.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-10 18:29:08 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-11 17:05:42 -0400
commit4ff70cc58be28f295b4ac953dbbb7c21bbe3777a (patch)
tree066444e32244d6e56b350fc383c3b1f862bff98c /runtime/menu.vim
parent750f2b686bd4fcb87db95724807b3ec7ce32ed49 (diff)
downloadrneovim-4ff70cc58be28f295b4ac953dbbb7c21bbe3777a.tar.gz
rneovim-4ff70cc58be28f295b4ac953dbbb7c21bbe3777a.tar.bz2
rneovim-4ff70cc58be28f295b4ac953dbbb7c21bbe3777a.zip
vim-patch:8.1.2416: loading menus sets v:errmsg
Problem: Loading menus sets v:errmsg. Solution: Avoid setting v:errmsg and add a test for that. (Jason Franklin) https://github.com/vim/vim/commit/e24c5b3332b453175e5f73423884087a4aef1247
Diffstat (limited to 'runtime/menu.vim')
-rw-r--r--runtime/menu.vim10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/menu.vim b/runtime/menu.vim
index cd56eb5583..78306a57b8 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 <Bram@vim.org>
-" Last Change: 2019 Jan 27
+" Last Change: 2019 Dec 10
" 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.
@@ -690,11 +690,11 @@ func! s:BMShow(...)
let g:bmenu_priority = a:1
endif
- " remove old menu, if exists; keep one entry to avoid a torn off menu to
- " disappear.
- silent! unmenu &Buffers
+ " Remove old menu, if exists; keep one entry to avoid a torn off menu to
+ " disappear. Use try/catch to avoid setting v:errmsg
+ try | unmenu &Buffers | catch | endtry
exe 'noremenu ' . g:bmenu_priority . ".1 &Buffers.Dummy l"
- silent! unmenu! &Buffers
+ try | unmenu! &Buffers | catch | endtry
" create new menu; set 'cpo' to include the <CR>
let cpo_save = &cpo