mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.0093: win_splitmove() can make Vim hang
Problem: win_splitmove() can make Vim hang. Solution: Check windows exists in the current tab page. (closes #5444)
This commit is contained in:
parent
a1353b5352
commit
7b94e77132
@ -808,7 +808,8 @@ f_win_splitmove(typval_T *argvars, typval_T *rettv)
|
|||||||
wp = find_win_by_nr_or_id(&argvars[0]);
|
wp = find_win_by_nr_or_id(&argvars[0]);
|
||||||
targetwin = find_win_by_nr_or_id(&argvars[1]);
|
targetwin = find_win_by_nr_or_id(&argvars[1]);
|
||||||
|
|
||||||
if (wp == NULL || targetwin == NULL || wp == targetwin)
|
if (wp == NULL || targetwin == NULL || wp == targetwin
|
||||||
|
|| !win_valid(wp) || !win_valid(targetwin))
|
||||||
{
|
{
|
||||||
emsg(_(e_invalwindow));
|
emsg(_(e_invalwindow));
|
||||||
rettv->vval.v_number = -1;
|
rettv->vval.v_number = -1;
|
||||||
|
@ -927,6 +927,10 @@ func Test_win_splitmove()
|
|||||||
call assert_fails('call win_splitmove(winnr(), 123)', 'E957:')
|
call assert_fails('call win_splitmove(winnr(), 123)', 'E957:')
|
||||||
call assert_fails('call win_splitmove(123, winnr())', 'E957:')
|
call assert_fails('call win_splitmove(123, winnr())', 'E957:')
|
||||||
call assert_fails('call win_splitmove(winnr(), winnr())', 'E957:')
|
call assert_fails('call win_splitmove(winnr(), winnr())', 'E957:')
|
||||||
|
|
||||||
|
tabnew
|
||||||
|
call assert_fails('call win_splitmove(1, win_getid(1, 1))', 'E957:')
|
||||||
|
tabclose
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -742,6 +742,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 */
|
||||||
|
/**/
|
||||||
|
93,
|
||||||
/**/
|
/**/
|
||||||
92,
|
92,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user