diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-03-30 22:12:12 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-03-30 22:12:12 +0200 |
commit | ae0f151ddf76dcbb233cff02282deb4f98a355ec (patch) | |
tree | 14a7095a7daa6e36ad45c17894dafe09993fac31 /src | |
parent | 82820d9bf14ba5374c24fff2ed6e577a67c6ddf2 (diff) |
patch 8.2.2679: status line missing for non-current window with winbarv8.2.2679
Problem: Winbar drawn over status line for non-current window with winbar
if frame is zero height. (Leonid V. Fedorenchik)
Solution: Do not draw the window if the frame height is zero. (closes #8037)
Diffstat (limited to 'src')
-rw-r--r-- | src/drawscreen.c | 31 | ||||
-rw-r--r-- | src/testdir/dumps/Test_winbar_not_visible.dump | 10 | ||||
-rw-r--r-- | src/testdir/test_winbar.vim | 20 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 57 insertions, 6 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index c2752bdd8a..051d94b232 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -378,6 +378,20 @@ update_screen(int type_arg) } /* + * 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. * * If inversion is possible we use it. Else '=' characters are used. @@ -401,6 +415,8 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) return; busy = TRUE; + row = statusline_row(wp); + wp->w_redr_status = FALSE; if (wp->w_status_height == 0) { @@ -500,7 +516,6 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) 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); @@ -524,8 +539,7 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) 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; } @@ -680,7 +694,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) 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; @@ -1468,8 +1482,13 @@ win_update(win_T *wp) 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; diff --git a/src/testdir/dumps/Test_winbar_not_visible.dump b/src/testdir/dumps/Test_winbar_not_visible.dump new file mode 100644 index 0000000000..894ac21eaf --- /dev/null +++ b/src/testdir/dumps/Test_winbar_not_visible.dump @@ -0,0 +1,10 @@ +|[+1&#ffffff0|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +> +0&&@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@74 diff --git a/src/testdir/test_winbar.vim b/src/testdir/test_winbar.vim index 3412ce5761..2cbdd013c4 100644 --- a/src/testdir/test_winbar.vim +++ b/src/testdir/test_winbar.vim @@ -4,6 +4,7 @@ source check.vim CheckFeature menu source shared.vim +source screendump.vim func Test_add_remove_menu() new @@ -121,4 +122,23 @@ func Test_redraw_after_scroll() 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 diff --git a/src/version.c b/src/version.c index 76ab0671ea..4947b56357 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2679, +/**/ 2678, /**/ 2677, |