mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
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)
e24c5b3332
This commit is contained in:
parent
750f2b686b
commit
4ff70cc58b
@ -2,24 +2,30 @@
|
|||||||
" Warning: This also deletes all menus defined by the user!
|
" Warning: This also deletes all menus defined by the user!
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2001 May 27
|
" Last Change: 2019 Dec 10
|
||||||
|
|
||||||
aunmenu *
|
aunmenu *
|
||||||
|
|
||||||
silent! unlet did_install_default_menus
|
unlet! g:did_install_default_menus
|
||||||
silent! unlet did_install_syntax_menu
|
unlet! g:did_install_syntax_menu
|
||||||
if exists("did_menu_trans")
|
|
||||||
|
if exists('g:did_menu_trans')
|
||||||
menutrans clear
|
menutrans clear
|
||||||
unlet did_menu_trans
|
unlet g:did_menu_trans
|
||||||
endif
|
endif
|
||||||
|
|
||||||
silent! unlet find_help_dialog
|
unlet! g:find_help_dialog
|
||||||
|
|
||||||
silent! unlet menutrans_help_dialog
|
unlet! g:menutrans_fileformat_choices
|
||||||
silent! unlet menutrans_path_dialog
|
unlet! g:menutrans_fileformat_dialog
|
||||||
silent! unlet menutrans_tags_dialog
|
unlet! g:menutrans_help_dialog
|
||||||
silent! unlet menutrans_textwidth_dialog
|
unlet! g:menutrans_no_file
|
||||||
silent! unlet menutrans_fileformat_dialog
|
unlet! g:menutrans_path_dialog
|
||||||
silent! unlet menutrans_no_file
|
unlet! g:menutrans_set_lang_to
|
||||||
|
unlet! g:menutrans_spell_add_ARG_to_word_list
|
||||||
|
unlet! g:menutrans_spell_change_ARG_to
|
||||||
|
unlet! g:menutrans_spell_ignore_ARG
|
||||||
|
unlet! g:menutrans_tags_dialog
|
||||||
|
unlet! g:menutrans_textwidth_dialog
|
||||||
|
|
||||||
" vim: set sw=2 :
|
" vim: set sw=2 :
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
" You can also use this as a start for your own set of menus.
|
" You can also use this as a start for your own set of menus.
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" 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
|
" 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.
|
" 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
|
let g:bmenu_priority = a:1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" remove old menu, if exists; keep one entry to avoid a torn off menu to
|
" Remove old menu, if exists; keep one entry to avoid a torn off menu to
|
||||||
" disappear.
|
" disappear. Use try/catch to avoid setting v:errmsg
|
||||||
silent! unmenu &Buffers
|
try | unmenu &Buffers | catch | endtry
|
||||||
exe 'noremenu ' . g:bmenu_priority . ".1 &Buffers.Dummy l"
|
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>
|
" create new menu; set 'cpo' to include the <CR>
|
||||||
let cpo_save = &cpo
|
let cpo_save = &cpo
|
||||||
|
@ -11,7 +11,13 @@ func Test_load_menu()
|
|||||||
call assert_report('error while loading menus: ' . v:exception)
|
call assert_report('error while loading menus: ' . v:exception)
|
||||||
endtry
|
endtry
|
||||||
call assert_match('browse confirm w', execute(':menu File.Save'))
|
call assert_match('browse confirm w', execute(':menu File.Save'))
|
||||||
|
|
||||||
|
let v:errmsg = ''
|
||||||
|
doautocmd LoadBufferMenu VimEnter
|
||||||
|
call assert_equal('', v:errmsg)
|
||||||
|
|
||||||
source $VIMRUNTIME/delmenu.vim
|
source $VIMRUNTIME/delmenu.vim
|
||||||
|
call assert_equal('', v:errmsg)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_translate_menu()
|
func Test_translate_menu()
|
||||||
|
Loading…
Reference in New Issue
Block a user