Skip to content

Commit 9e1e358

Browse files
committed
patch 8.1.1088: height of quickfix window not retained with vertical split
Problem: Height of quickfix window not retained with vertical split. Solution: Use frame_fixed_height() and frame_fixed_width(). (Hongbo Liu, closes #4013, closes #2998)
1 parent 7559dce commit 9e1e358

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

src/testdir/test_winbuf_close.vim

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,29 @@ func Test_winfixwidth_on_close()
158158
%bwipeout!
159159
setlocal nowinfixwidth splitbelow& splitright&
160160
endfunction
161+
162+
" Test that 'winfixheight' will be respected even there is non-leaf frame
163+
fun! Test_winfixheight_non_leaf_frame()
164+
vsplit
165+
botright 11new
166+
let l:wid = win_getid()
167+
setlocal winfixheight
168+
call assert_equal(11, winheight(l:wid))
169+
botright new
170+
bwipe!
171+
call assert_equal(11, winheight(l:wid))
172+
%bwipe!
173+
endf
174+
175+
" Test that 'winfixwidth' will be respected even there is non-leaf frame
176+
fun! Test_winfixwidth_non_leaf_frame()
177+
split
178+
topleft 11vnew
179+
let l:wid = win_getid()
180+
setlocal winfixwidth
181+
call assert_equal(11, winwidth(l:wid))
182+
topleft new
183+
bwipe!
184+
call assert_equal(11, winwidth(l:wid))
185+
%bwipe!
186+
endf

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ static char *(features[]) =
775775

776776
static int included_patches[] =
777777
{ /* Add new patch number below this line */
778+
/**/
779+
1088,
778780
/**/
779781
1087,
780782
/**/

src/window.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,10 +2677,10 @@ winframe_remove(
26772677
{
26782678
if (frp != NULL)
26792679
{
2680-
if (frp->fr_win != NULL && !frp->fr_win->w_p_wfh)
2680+
if (!frame_fixed_height(frp))
26812681
{
26822682
frp2 = frp;
2683-
wp = frp->fr_win;
2683+
wp = frame2win(frp2);
26842684
break;
26852685
}
26862686
frp = frp->fr_prev;
@@ -2714,10 +2714,10 @@ winframe_remove(
27142714
{
27152715
if (frp != NULL)
27162716
{
2717-
if (frp->fr_win != NULL && !frp->fr_win->w_p_wfw)
2717+
if (!frame_fixed_width(frp))
27182718
{
27192719
frp2 = frp;
2720-
wp = frp->fr_win;
2720+
wp = frame2win(frp2);
27212721
break;
27222722
}
27232723
frp = frp->fr_prev;

0 commit comments

Comments
 (0)