summaryrefslogtreecommitdiff
path: root/src/testdir/test_window_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-22 14:41:22 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-22 14:41:22 +0100
commit9b9be007e7d674f49fc2b650f840d08532b180ad (patch)
treea46f35832d394dc8c3063ccf00860502179adda5 /src/testdir/test_window_cmd.vim
parent515545e11f523d14343b1e588dc0b9bd3d362bc2 (diff)
downloadvim-git-9b9be007e7d674f49fc2b650f840d08532b180ad.tar.gz
patch 8.2.0426: some errors were not tested forv8.2.0426
Problem: Some errors were not tested for. Solution: Add tests. (Dominique Pelle, closes #5824)
Diffstat (limited to 'src/testdir/test_window_cmd.vim')
-rw-r--r--src/testdir/test_window_cmd.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index ceba4be37..5519ffdad 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -174,6 +174,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_preview()
CheckFeature quickfix