Patch 8.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)
Files:      src/drawscreen.c, src/testdir/test_winbar.vim,
            src/testdir/dumps/Test_winbar_not_visible.dump


*** ../vim-8.2.2678/src/drawscreen.c    2021-03-03 13:25:59.535913158 +0100
--- src/drawscreen.c    2021-03-30 22:03:26.867325579 +0200
***************
*** 378,383 ****
--- 378,397 ----
  }
  
  /*
+  * 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,406 ****
--- 415,422 ----
        return;
      busy = TRUE;
  
+     row = statusline_row(wp);
+ 
      wp->w_redr_status = FALSE;
      if (wp->w_status_height == 0)
      {
***************
*** 500,506 ****
            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);
--- 516,521 ----
***************
*** 524,531 ****
            fillchar = fillchar_status(&attr, wp);
        else
            fillchar = fillchar_vsep(&attr);
!       screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp),
!                                                                       attr);
      }
      busy = FALSE;
  }
--- 539,545 ----
            fillchar = fillchar_status(&attr, wp);
        else
            fillchar = fillchar_vsep(&attr);
!       screen_putchar(fillchar, row, W_ENDCOL(wp), attr);
      }
      busy = FALSE;
  }
***************
*** 680,686 ****
        cursor_off();
        if (wp->w_status_height)
        {
!           row = W_WINROW(wp) + wp->w_height;
            fillchar = fillchar_status(&attr, wp);
            off = wp->w_wincol;
            width = wp->w_width;
--- 694,700 ----
        cursor_off();
        if (wp->w_status_height)
        {
!           row = statusline_row(wp);
            fillchar = fillchar_status(&attr, wp);
            off = wp->w_wincol;
            width = wp->w_width;
***************
*** 1468,1475 ****
        wp->w_lines_valid = 0;
      }
  
!     // Window is zero-height: nothing to draw.
!     if (wp->w_height + WINBAR_HEIGHT(wp) == 0)
      {
        wp->w_redr_type = 0;
        return;
--- 1482,1494 ----
        wp->w_lines_valid = 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;
*** ../vim-8.2.2678/src/testdir/test_winbar.vim 2020-09-04 21:18:40.492161906 
+0200
--- src/testdir/test_winbar.vim 2021-03-30 21:49:47.258639701 +0200
***************
*** 4,9 ****
--- 4,10 ----
  CheckFeature menu
  
  source shared.vim
+ source screendump.vim
  
  func Test_add_remove_menu()
    new
***************
*** 121,124 ****
--- 122,144 ----
    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
*** ../vim-8.2.2678/src/testdir/dumps/Test_winbar_not_visible.dump      
2021-03-30 22:11:42.833713675 +0200
--- src/testdir/dumps/Test_winbar_not_visible.dump      2021-03-30 
22:04:35.379094189 +0200
***************
*** 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
*** ../vim-8.2.2678/src/version.c       2021-03-30 20:54:24.151493074 +0200
--- src/version.c       2021-03-30 21:24:03.483352095 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2679,
  /**/

-- 
Everyone has a photographic memory. Some don't have film.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202103302013.12UKDNU81515565%40masaka.moolenaar.net.

Raspunde prin e-mail lui