return OK;
}
+/*
+ * Return the row for drawing the statusline and the ruler of window "wp".
+ */
+ static int
+statusline_row(win_T *wp)
+{
+#if defined(FEAT_PROP_POPUP)
+ // If the window is really zero height the winbar isn't displayed.
+ if (wp->w_frame->fr_height == wp->w_status_height && !popup_is_popup(wp))
+ return wp->w_winrow;
+#endif
+ return W_WINROW(wp) + wp->w_height;
+}
+
/*
* Redraw the status line of window wp.
*
return;
busy = TRUE;
+ row = statusline_row(wp);
+
wp->w_redr_status = FALSE;
if (wp->w_status_height == 0)
{
len = this_ru_col - 1;
}
- row = W_WINROW(wp) + wp->w_height;
screen_puts(p, row, wp->w_wincol, attr);
screen_fill(row, row + 1, len + wp->w_wincol,
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);
fillchar = fillchar_status(&attr, wp);
else
fillchar = fillchar_vsep(&attr);
- screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp),
- attr);
+ screen_putchar(fillchar, row, W_ENDCOL(wp), attr);
}
busy = FALSE;
}
cursor_off();
if (wp->w_status_height)
{
- row = W_WINROW(wp) + wp->w_height;
+ row = statusline_row(wp);
fillchar = fillchar_status(&attr, wp);
off = wp->w_wincol;
width = wp->w_width;
wp->w_lines_valid = 0;
}
- // Window is zero-height: nothing to draw.
- if (wp->w_height + WINBAR_HEIGHT(wp) == 0)
+ // Window frame is zero-height: nothing to draw.
+ if (wp->w_height + WINBAR_HEIGHT(wp) == 0
+ || (wp->w_frame->fr_height == wp->w_status_height
+#if defined(FEAT_PROP_POPUP)
+ && !popup_is_popup(wp)
+#endif
+ ))
{
wp->w_redr_type = 0;
return;
CheckFeature menu
source shared.vim
+source screendump.vim
func Test_add_remove_menu()
new
bwipe!
endfunc
+func Test_winbar_not_visible()
+ CheckScreendump
+
+ let lines =<< trim END
+ split
+ nnoremenu WinBar.Test :test
+ set winminheight=0
+ wincmd j
+ wincmd _
+ END
+ call writefile(lines, 'XtestWinbarNotVisble')
+ let buf = RunVimInTerminal('-S XtestWinbarNotVisble', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_winbar_not_visible', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestWinbarNotVisble')
+endfunction
+
" vim: shiftwidth=2 sts=2 expandtab