mirror of
https://github.com/vim/vim.git
synced 2025-09-02 21:13:50 -04:00
patch 9.0.1332: crash when using buffer-local user command in cmdline window
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)
This commit is contained in:
parent
e1121b1394
commit
b444ee761a
@ -856,6 +856,15 @@ func Test_buflocal_ambiguous_usercmd()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
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\<CR>", 'E11:')
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for using a multibyte character in a user command
|
" Test for using a multibyte character in a user command
|
||||||
func Test_multibyte_in_usercmd()
|
func Test_multibyte_in_usercmd()
|
||||||
command SubJapanesePeriodToDot exe "%s/\u3002/./g"
|
command SubJapanesePeriodToDot exe "%s/\u3002/./g"
|
||||||
|
@ -1838,7 +1838,7 @@ do_ucmd(exarg_T *eap)
|
|||||||
if (eap->cmdidx == CMD_USER)
|
if (eap->cmdidx == CMD_USER)
|
||||||
cmd = USER_CMD(eap->useridx);
|
cmd = USER_CMD(eap->useridx);
|
||||||
else
|
else
|
||||||
cmd = USER_CMD_GA(&curbuf->b_ucmds, eap->useridx);
|
cmd = USER_CMD_GA(&prevwin_curwin()->w_buffer->b_ucmds, eap->useridx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace <> in the command by the arguments.
|
* Replace <> in the command by the arguments.
|
||||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1332,
|
||||||
/**/
|
/**/
|
||||||
1331,
|
1331,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user