From 7c26be61bb5a405f28ae230cd3602ecb6e30a3a9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 27 Oct 2019 11:28:13 -0400 Subject: vim-patch:8.1.1245: ":copen 10" sets height in full-height window Problem: ":copen 10" sets height in full-height window. (Daniel Hahler) Solution: Don't set the height if the quickfix window is full height. (closes vim/vim#4325) https://github.com/vim/vim/commit/36d502225c3ec5e8b30771d58ee20171ce564b2f --- src/nvim/quickfix.c | 3 ++- src/nvim/testdir/test_quickfix.vim | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 8f891751d6..d900ea3c70 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3164,7 +3164,8 @@ static int qf_goto_cwindow(const qf_info_T *qi, bool resize, int sz, if (sz != win->w_width) { win_setwidth(sz); } - } else if (sz != win->w_height) { + } else if (sz != win->w_height + && win->w_height + win->w_status_height < cmdline_row) { win_setheight(sz); } } diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 6f58b0084c..2eb20e61bd 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -273,6 +273,15 @@ func Test_cwindow() call XwindowTests('l') endfunc +func Test_copenHeight() + copen + wincmd H + let height = winheight(0) + copen 10 + call assert_equal(height, winheight(0)) + quit +endfunc + " Tests for the :cfile, :lfile, :caddfile, :laddfile, :cgetfile and :lgetfile " commands. func XfileTests(cchar) -- cgit From 0f7a645f544cb02d6a48749a5f60f8c43e89fd3d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 27 Oct 2019 11:31:38 -0400 Subject: vim-patch:8.1.2154: quickfix window height wrong when there is a tabline Problem: Quickfix window height wrong when there is a tabline. (Daniel Hahler) Solution: Take the tabline height into account. (closes vim/vim#5058) https://github.com/vim/vim/commit/1142a31b8c44c4e7dbf28a83ae52995113b37917 --- src/nvim/quickfix.c | 3 ++- src/nvim/testdir/test_quickfix.vim | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index d900ea3c70..4ca9ca2a3e 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3165,7 +3165,8 @@ static int qf_goto_cwindow(const qf_info_T *qi, bool resize, int sz, win_setwidth(sz); } } else if (sz != win->w_height - && win->w_height + win->w_status_height < cmdline_row) { + && (win->w_height + win->w_status_height + tabline_height() + < cmdline_row)) { win_setheight(sz); } } diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 2eb20e61bd..31b0c0cd2c 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -282,6 +282,18 @@ func Test_copenHeight() quit endfunc +func Test_copenHeight_tabline() + set tabline=foo showtabline=2 + copen + wincmd H + let height = winheight(0) + copen 10 + call assert_equal(height, winheight(0)) + quit + set tabline& showtabline& +endfunc + + " Tests for the :cfile, :lfile, :caddfile, :laddfile, :cgetfile and :lgetfile " commands. func XfileTests(cchar) -- cgit