diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-02 09:06:38 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-02 09:06:38 +0800 |
| commit | 44b88d8c310e778c55ef1f7a270d2651266054ca (patch) | |
| tree | 371299acff87e8f92ad113c25ce72a44f3e64223 /src/nvim/testdir | |
| parent | 41f308feab35007534f0c213947701174d60c548 (diff) | |
| parent | 419ee612e692fb8985342a2091a0d9bf6dfffe46 (diff) | |
| download | rneovim-44b88d8c310e778c55ef1f7a270d2651266054ca.tar.gz rneovim-44b88d8c310e778c55ef1f7a270d2651266054ca.tar.bz2 rneovim-44b88d8c310e778c55ef1f7a270d2651266054ca.zip | |
Merge pull request #20904 from zeertzjq/vim-9.0.0822
vim-patch:9.0.{0822,0823,0824,0825}: window dragging fixes
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_mapping.vim | 24 | ||||
| -rw-r--r-- | src/nvim/testdir/test_window_cmd.vim | 10 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 2d8c45210b..560883ba5d 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -1050,6 +1050,30 @@ func Test_mouse_drag_mapped_start_select() set mouse& endfunc +func Test_mouse_drag_statusline() + set laststatus=2 + set mouse=a + func ClickExpr() + call Ntest_setmouse(&lines - 1, 1) + return "\<LeftMouse>" + endfunc + func DragExpr() + call Ntest_setmouse(&lines - 2, 1) + return "\<LeftDrag>" + endfunc + nnoremap <expr> <F2> ClickExpr() + nnoremap <expr> <F3> DragExpr() + + " this was causing a crash in win_drag_status_line() + call feedkeys("\<F2>:tabnew\<CR>\<F3>", 'tx') + + nunmap <F2> + nunmap <F3> + delfunc ClickExpr + delfunc DragExpr + set laststatus& mouse& +endfunc + " Test for mapping <LeftDrag> in Insert mode func Test_mouse_drag_insert_map() set mouse=a diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim index 902a3791d4..f38eaaf318 100644 --- a/src/nvim/testdir/test_window_cmd.vim +++ b/src/nvim/testdir/test_window_cmd.vim @@ -1393,17 +1393,20 @@ 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 floating window let id = nvim_open_win( \ 0, 0, #{relative: 'editor', row: 2, col: 2, width: 5, height: 3}) @@ -1411,6 +1414,13 @@ func Test_win_move_separator() call assert_false(win_move_separator(id, 1)) call assert_equal(w, winwidth(id)) call nvim_win_close(id, 1) + + " 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 |