diff options
author | Andy K. Massimino <f8a663@normed.space> | 2021-03-18 22:57:27 -0400 |
---|---|---|
committer | Andy K. Massimino <f8a663@normed.space> | 2021-03-19 23:02:34 -0400 |
commit | b2ec77007081cf9c63f935115f69c718db248226 (patch) | |
tree | 5da5021eba90e2cc106e3fa4a0b561f8d952f83b /src | |
parent | 1ef4340f22b915dc7ae2afdb2e88599133a20537 (diff) | |
download | rneovim-b2ec77007081cf9c63f935115f69c718db248226.tar.gz rneovim-b2ec77007081cf9c63f935115f69c718db248226.tar.bz2 rneovim-b2ec77007081cf9c63f935115f69c718db248226.zip |
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)
https://github.com/vim/vim/commit/7b94e77132eabdf0e43abca57e2ffeb961545174
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/funcs.c | 3 | ||||
-rw-r--r-- | src/nvim/testdir/test_window_cmd.vim | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 6d6b701169..7fb3ccd737 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -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; diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim index b57c4e27da..402c2c3eb7 100644 --- a/src/nvim/testdir/test_window_cmd.vim +++ b/src/nvim/testdir/test_window_cmd.vim @@ -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() |