# HG changeset patch # User Bram Moolenaar # Date 1578341706 -3600 # Node ID ef3633932b0c771290c17571e28f165015cd6c2c # Parent 76a2ab83e2c5cb737bf34152b9d4df4c22310b49 patch 8.2.0093: win_splitmove() can make Vim hang Commit: https://github.com/vim/vim/commit/7b94e77132eabdf0e43abca57e2ffeb961545174 Author: Bram Moolenaar Date: Mon Jan 6 21:03:24 2020 +0100 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 https://github.com/vim/vim/issues/5444) diff --git a/src/evalwindow.c b/src/evalwindow.c --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -808,7 +808,8 @@ f_win_splitmove(typval_T *argvars, typva 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; diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -927,6 +927,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 " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 93, +/**/ 92, /**/ 91,