diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-01 11:44:43 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-01 11:44:43 +0000 |
commit | 873f41a0187e81a22aa4622fbf938de72a54abba (patch) | |
tree | e129244b90c0a84d6a1e4f4b027ccdc8c5af1f81 /src/testdir/test_window_cmd.vim | |
parent | 7a7db047dcb2336de5103e793345eb5a9d125900 (diff) |
patch 9.0.0824: crash when using win_move_separator() in other tab pagev9.0.0824
Problem: Crash when using win_move_separator() in other tab page.
Solution: Check for valid window in current tab page.
(closes #11479, closes #11427)
Diffstat (limited to 'src/testdir/test_window_cmd.vim')
-rw-r--r-- | src/testdir/test_window_cmd.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index 8a71913408..0d4c278e63 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -1483,23 +1483,33 @@ func Test_win_move_separator() call assert_equal(w0, winwidth(0)) call assert_true(win_move_separator(0, -1)) call assert_equal(w0, winwidth(0)) + " check that win_move_separator doesn't error with offsets beyond moving " possibility call assert_true(win_move_separator(id, 5000)) call assert_true(winwidth(id) > w) call assert_true(win_move_separator(id, -5000)) call assert_true(winwidth(id) < w) + " check that win_move_separator returns false for an invalid window wincmd = let w = winwidth(0) call assert_false(win_move_separator(-1, 1)) call assert_equal(w, winwidth(0)) + " check that win_move_separator returns false for a popup window let id = popup_create(['hello', 'world'], {}) let w = winwidth(id) call assert_false(win_move_separator(id, 1)) call assert_equal(w, winwidth(id)) call popup_close(id) + + " check that using another tabpage fails without crash + let id = win_getid() + tabnew + call assert_fails('call win_move_separator(id, -1)', 'E1308:') + tabclose + %bwipe! endfunc |