]> granicus.if.org Git - vim/commitdiff
patch 8.2.2685: custom statusline not drawn correctly with WinBar v8.2.2685
authorBram Moolenaar <Bram@vim.org>
Thu, 1 Apr 2021 14:16:18 +0000 (16:16 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 1 Apr 2021 14:16:18 +0000 (16:16 +0200)
Problem:    Custom statusline not drawn correctly with WinBar.
Solution:   Also adjust the column for the custom status line. (Yee Cheng
            Chin, closes #8047)

src/drawscreen.c
src/proto/drawscreen.pro
src/screen.c
src/testdir/dumps/Test_winbar_not_visible_custom_statusline.dump [new file with mode: 0644]
src/testdir/test_winbar.vim
src/version.c

index 051d94b232fcbef1ec20e1c5cae378e9d4126e70..0e36e7917357e116f71b6d2db6b8485e0c567665 100644 (file)
@@ -380,7 +380,7 @@ update_screen(int type_arg)
 /*
  * Return the row for drawing the statusline and the ruler of window "wp".
  */
-    static int
+    int
 statusline_row(win_T *wp)
 {
 #if defined(FEAT_PROP_POPUP)
index 7414fa0936d997111da89133c3ed1b3b2b3605bb..528c8b21923ca844c2c1aaec9a33cddae225cb6b 100644 (file)
@@ -1,5 +1,6 @@
 /* drawscreen.c */
 int update_screen(int type_arg);
+int statusline_row(win_T *wp);
 void showruler(int always);
 void win_redr_ruler(win_T *wp, int always, int ignore_pum);
 void after_updating_screen(int may_resize_shell);
index d219b13c38330b5a4772cf0ad7e4c851e62b562f..9d5d4df98cc3c26bf543f2deb9b88eef15cbc7ca 100644 (file)
@@ -1248,7 +1248,7 @@ win_redr_custom(
     }
     else
     {
-       row = W_WINROW(wp) + wp->w_height;
+       row = statusline_row(wp);
        fillchar = fillchar_status(&attr, wp);
        maxwidth = wp->w_width;
 
diff --git a/src/testdir/dumps/Test_winbar_not_visible_custom_statusline.dump b/src/testdir/dumps/Test_winbar_not_visible_custom_statusline.dump
new file mode 100644 (file)
index 0000000..9eff5ba
--- /dev/null
@@ -0,0 +1,10 @@
+|a+1&#ffffff0|b|c|d|e| @69
+> +0&&@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|a+3#0000000&|b|c|d|e| @69
+| +0&&@74
index 2cbdd013c43637f068e1fca0bc04197d90743aa2..92da3128f64bc27271f5a7ddb51a378bca69eeb7 100644 (file)
@@ -141,4 +141,24 @@ func Test_winbar_not_visible()
   call delete('XtestWinbarNotVisble')
 endfunction
 
+func Test_winbar_not_visible_custom_statusline()
+  CheckScreendump
+
+  let lines =<< trim END
+      split
+      nnoremenu WinBar.Test :test
+      set winminheight=0
+      set statusline=abcde
+      wincmd j
+      wincmd _
+  END
+  call writefile(lines, 'XtestWinbarNotVisble')
+  let buf = RunVimInTerminal('-S XtestWinbarNotVisble', #{rows: 10})
+  call VerifyScreenDump(buf, 'Test_winbar_not_visible_custom_statusline', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XtestWinbarNotVisble')
+endfunction
+
 " vim: shiftwidth=2 sts=2 expandtab
index 943a6f60166bdeff8a60693e8c2c218b86b740b7..8a6e1642a68db588479ed1e4a9b1be159c64456d 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2685,
 /**/
     2684,
 /**/