diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-15 16:49:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-15 16:49:00 +0800 |
| commit | 564d99c89a3d9a236df758d320cc38abc50215ec (patch) | |
| tree | 9798e6718ce448953e32caf604641b063f58b5fc /src/nvim/testdir/test_window_cmd.vim | |
| parent | 9777907467b29e890556db287b6a9995c0024896 (diff) | |
| parent | a649af4dbaba5ef13dcbf610fe584dbc67cf2435 (diff) | |
| download | rneovim-564d99c89a3d9a236df758d320cc38abc50215ec.tar.gz rneovim-564d99c89a3d9a236df758d320cc38abc50215ec.tar.bz2 rneovim-564d99c89a3d9a236df758d320cc38abc50215ec.zip | |
Merge pull request #19373 from zeertzjq/vim-8.2.0426
vim-patch:8.0.1118,8.2.0426
Diffstat (limited to 'src/nvim/testdir/test_window_cmd.vim')
| -rw-r--r-- | src/nvim/testdir/test_window_cmd.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim index cbc8ad05d2..41b0cd874c 100644 --- a/src/nvim/testdir/test_window_cmd.vim +++ b/src/nvim/testdir/test_window_cmd.vim @@ -172,6 +172,35 @@ func Test_window_split_edit_bufnr() %bw! endfunc +func Test_window_split_no_room() + " N horizontal windows need >= 2*N + 1 lines: + " - 1 line + 1 status line in each window + " - 1 Ex command line + " + " 2*N + 1 <= &lines + " N <= (lines - 1)/2 + " + " Beyond that number of windows, E36: Not enough room is expected. + let hor_win_count = (&lines - 1)/2 + let hor_split_count = hor_win_count - 1 + for s in range(1, hor_split_count) | split | endfor + call assert_fails('split', 'E36:') + + " N vertical windows need >= 2*(N - 1) + 1 columns: + " - 1 column + 1 separator for each window (except last window) + " - 1 column for the last window which does not have separator + " + " 2*(N - 1) + 1 <= &columns + " 2*N - 1 <= &columns + " N <= (&columns + 1)/2 + let ver_win_count = (&columns + 1)/2 + let ver_split_count = ver_win_count - 1 + for s in range(1, ver_split_count) | vsplit | endfor + call assert_fails('vsplit', 'E36:') + + %bw! +endfunc + func Test_window_exchange() e Xa |