mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.1411: reading invalid memory with CTRL-W :
Problem: Reading invalid memory with CTRL-W :.
Solution: Correct the command characters. (closes vim/vim#2469)
2efb323e87
This commit is contained in:
parent
de2e86a698
commit
d8d4f05564
@ -6528,6 +6528,8 @@ static void nv_window(cmdarg_T *cap)
|
|||||||
{
|
{
|
||||||
if (cap->nchar == ':') {
|
if (cap->nchar == ':') {
|
||||||
// "CTRL-W :" is the same as typing ":"; useful in a terminal window
|
// "CTRL-W :" is the same as typing ":"; useful in a terminal window
|
||||||
|
cap->cmdchar = ':';
|
||||||
|
cap->nchar = NUL;
|
||||||
nv_colon(cap);
|
nv_colon(cap);
|
||||||
} else if (!checkclearop(cap->oap)) {
|
} else if (!checkclearop(cap->oap)) {
|
||||||
do_window(cap->nchar, cap->count0, NUL); // everything is in window.c
|
do_window(cap->nchar, cap->count0, NUL); // everything is in window.c
|
||||||
|
@ -153,6 +153,10 @@ int get_op_type(int char1, int char2)
|
|||||||
if (opchars[i][0] == char1 && opchars[i][1] == char2) {
|
if (opchars[i][0] == char1 && opchars[i][1] == char2) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (i == (int)(sizeof(opchars) / sizeof(char [3]) - 1)) {
|
||||||
|
internal_error("get_op_type()");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -691,4 +691,9 @@ func Test_winnr()
|
|||||||
only | tabonly
|
only | tabonly
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_window_colon_command()
|
||||||
|
" This was reading invalid memory.
|
||||||
|
exe "norm! v\<C-W>:\<C-U>echo v:version"
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user