To: vim_dev@googlegroups.com Subject: Patch 8.1.2416 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2416 Problem: Loading menus sets v:errmsg. Solution: Avoid setting v:errmsg and add a test for that. (Jason Franklin) Files: runtime/delmenu.vim, runtime/menu.vim, src/testdir/test_menu.vim *** ../vim-8.1.2415/runtime/delmenu.vim 2018-10-19 22:35:04.885189994 +0200 --- runtime/delmenu.vim 2019-12-10 21:59:43.583172682 +0100 *************** *** 2,26 **** " Warning: This also deletes all menus defined by the user! " " Maintainer: Bram Moolenaar ! " Last Change: 2001 May 27 aunmenu * tlunmenu * ! silent! unlet did_install_default_menus ! silent! unlet did_install_syntax_menu ! if exists("did_menu_trans") menutrans clear ! unlet did_menu_trans endif ! silent! unlet find_help_dialog ! silent! unlet menutrans_help_dialog ! silent! unlet menutrans_path_dialog ! silent! unlet menutrans_tags_dialog ! silent! unlet menutrans_textwidth_dialog ! silent! unlet menutrans_fileformat_dialog ! silent! unlet menutrans_no_file " vim: set sw=2 : --- 2,32 ---- " Warning: This also deletes all menus defined by the user! " " Maintainer: Bram Moolenaar ! " Last Change: 2019 Dec 10 aunmenu * tlunmenu * ! unlet! g:did_install_default_menus ! unlet! g:did_install_syntax_menu ! ! if exists('g:did_menu_trans') menutrans clear ! unlet g:did_menu_trans endif ! unlet! g:find_help_dialog ! unlet! g:menutrans_fileformat_choices ! unlet! g:menutrans_fileformat_dialog ! unlet! g:menutrans_help_dialog ! unlet! g:menutrans_no_file ! unlet! g:menutrans_path_dialog ! 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-8.1.2415/runtime/menu.vim 2018-10-19 22:35:04.885189994 +0200 --- runtime/menu.vim 2019-12-10 22:06:33.321794127 +0100 *************** *** 2,8 **** " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar ! " 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. --- 2,8 ---- " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar ! " 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. *************** *** 693,703 **** 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 exe 'noremenu ' . g:bmenu_priority . ".1 &Buffers.Dummy l" ! silent! unmenu! &Buffers " create new menu; set 'cpo' to include the let cpo_save = &cpo --- 700,710 ---- let g:bmenu_priority = a:1 endif ! " 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" ! try | unmenu! &Buffers | catch | endtry " create new menu; set 'cpo' to include the let cpo_save = &cpo *** ../vim-8.1.2415/src/testdir/test_menu.vim 2019-06-15 17:57:43.972724036 +0200 --- src/testdir/test_menu.vim 2019-12-10 22:02:30.930622018 +0100 *************** *** 10,16 **** --- 10,22 ---- call assert_report('error while loading menus: ' . v:exception) endtry 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 + call assert_equal('', v:errmsg) endfunc func Test_translate_menu() *** ../vim-8.1.2415/src/version.c 2019-12-10 21:50:52.628700483 +0100 --- src/version.c 2019-12-10 21:58:19.795439536 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 2416, /**/ -- "After a few years of marriage a man can look right at a woman without seeing her and a woman can see right through a man without looking at him." - Helen Rowland /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///