To: vim_dev@googlegroups.com Subject: Patch 9.0.1332 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1332 Problem: Crash when using buffer-local user command in cmdline window. (Karl Yngve LervÄg) Solution: Use the right buffer to find the user command. (closes #12030, closes #12029) Files: src/usercmd.c, src/testdir/test_usercommands.vim *** ../vim-9.0.1331/src/usercmd.c 2023-01-27 21:03:08.899101847 +0000 --- src/usercmd.c 2023-02-20 15:21:12.172330017 +0000 *************** *** 1838,1844 **** if (eap->cmdidx == CMD_USER) cmd = USER_CMD(eap->useridx); else ! cmd = USER_CMD_GA(&curbuf->b_ucmds, eap->useridx); /* * Replace <> in the command by the arguments. --- 1838,1844 ---- if (eap->cmdidx == CMD_USER) cmd = USER_CMD(eap->useridx); else ! cmd = USER_CMD_GA(&prevwin_curwin()->w_buffer->b_ucmds, eap->useridx); /* * Replace <> in the command by the arguments. *** ../vim-9.0.1331/src/testdir/test_usercommands.vim 2022-12-19 16:49:23.886882904 +0000 --- src/testdir/test_usercommands.vim 2023-02-20 15:21:12.172330017 +0000 *************** *** 856,861 **** --- 856,870 ---- bw! endfunc + " Test for using buffer-local user command from cmdwin. + func Test_buflocal_usercmd_cmdwin() + new + command -buffer TestCmd edit Test + " This used to crash Vim + call assert_fails("norm q::TestCmd\", 'E11:') + bw! + endfunc + " Test for using a multibyte character in a user command func Test_multibyte_in_usercmd() command SubJapanesePeriodToDot exe "%s/\u3002/./g" *** ../vim-9.0.1331/src/version.c 2023-02-20 14:35:16.999853781 +0000 --- src/version.c 2023-02-20 15:23:35.628587846 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1332, /**/ -- hundred-and-one symptoms of being an internet addict: 160. You get in the elevator and double-click the button for the floor you want. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///