mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
vim-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 vim/vim#5444)
7b94e77132
This commit is contained in:
@@ -4031,7 +4031,8 @@ static void f_win_splitmove(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
wp = find_win_by_nr_or_id(&argvars[0]);
|
||||
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));
|
||||
rettv->vval.v_number = -1;
|
||||
return;
|
||||
|
@@ -839,6 +839,10 @@ func Test_win_splitmove()
|
||||
call assert_fails('call win_splitmove(winnr(), 123)', 'E957:')
|
||||
call assert_fails('call win_splitmove(123, 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
|
||||
|
||||
func Test_window_resize()
|
||||
|
Reference in New Issue
Block a user