Patch 9.0.0639
Problem:    Checking for popup in screen_char() is too late, the attribute has
            already been changed.
Solution:   Move check for popup to where screen_char() is called.
Files:      src/screen.c


*** ../vim-9.0.0638/src/screen.c        2022-10-02 15:17:13.837211460 +0100
--- src/screen.c        2022-10-02 15:06:50.093846439 +0100
***************
*** 728,734 ****
        col += char_cells;
      }
  
!     if (clear_next)
      {
        // Clear the second half of a double-wide character of which the left
        // half was overwritten with a single-wide character.
--- 728,734 ----
        col += char_cells;
      }
  
!     if (clear_next && !skip_for_popup(row, col + coloff))
      {
        // Clear the second half of a double-wide character of which the left
        // half was overwritten with a single-wide character.
***************
*** 792,803 ****
                        }
                    }
  
!                   if (enc_dbcs != 0 && prev_cells > 1)
!                       screen_char_2(off_to - prev_cells, row,
                                                   col + coloff - prev_cells);
!                   else
!                       screen_char(off_to - prev_cells, row,
                                                   col + coloff - prev_cells);
                }
            }
  #endif
--- 792,806 ----
                        }
                    }
  
!                   if (!skip_for_popup(row, col + coloff - prev_cells))
!                   {
!                       if (enc_dbcs != 0 && prev_cells > 1)
!                           screen_char_2(off_to - prev_cells, row,
                                                   col + coloff - prev_cells);
!                       else
!                           screen_char(off_to - prev_cells, row,
                                                   col + coloff - prev_cells);
+                   }
                }
            }
  #endif
***************
*** 821,829 ****
        // right of the window contents.  But not on top of a popup window.
        if (coloff + col < Columns)
        {
! #ifdef FEAT_PROP_POPUP
!           if (!blocked_by_popup(row, col + coloff))
! #endif
            {
                int c;
  
--- 824,830 ----
        // right of the window contents.  But not on top of a popup window.
        if (coloff + col < Columns)
        {
!           if (!skip_for_popup(row, col + coloff))
            {
                int c;
  
***************
*** 1564,1578 ****
  #endif
            && mb_fix_col(col, row) != col)
      {
!       ScreenLines[off - 1] = ' ';
!       ScreenAttrs[off - 1] = 0;
!       if (enc_utf8)
        {
!           ScreenLinesUC[off - 1] = 0;
!           ScreenLinesC[0][off - 1] = 0;
        }
-       // redraw the previous cell, make it empty
-       screen_char(off - 1, row, col - 1);
        // force the cell at "col" to be redrawn
        force_redraw_next = TRUE;
      }
--- 1565,1582 ----
  #endif
            && mb_fix_col(col, row) != col)
      {
!       if (!skip_for_popup(row, col - 1))
        {
!           ScreenLines[off - 1] = ' ';
!           ScreenAttrs[off - 1] = 0;
!           if (enc_utf8)
!           {
!               ScreenLinesUC[off - 1] = 0;
!               ScreenLinesC[0][off - 1] = 0;
!           }
!           // redraw the previous cell, make it empty
!           screen_char(off - 1, row, col - 1);
        }
        // force the cell at "col" to be redrawn
        force_redraw_next = TRUE;
      }
***************
*** 1651,1661 ****
                || ScreenAttrs[off] != attr
                || exmode_active;
  
!       if ((need_redraw || force_redraw_this)
! #ifdef FEAT_PROP_POPUP
!               && !blocked_by_popup(row, col)
! #endif
!          )
        {
  #if defined(FEAT_GUI) || defined(UNIX)
            // The bold trick makes a single row of pixels appear in the next
--- 1655,1661 ----
                || ScreenAttrs[off] != attr
                || exmode_active;
  
!       if ((need_redraw || force_redraw_this) && !skip_for_popup(row, col))
        {
  #if defined(FEAT_GUI) || defined(UNIX)
            // The bold trick makes a single row of pixels appear in the next
***************
*** 1772,1778 ****
  
      // If we detected the next character needs to be redrawn, but the text
      // doesn't extend up to there, update the character here.
!     if (force_redraw_next && col < screen_Columns)
      {
        if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
            screen_char_2(off, row, col);
--- 1772,1778 ----
  
      // If we detected the next character needs to be redrawn, but the text
      // doesn't extend up to there, update the character here.
!     if (force_redraw_next && col < screen_Columns && !skip_for_popup(row, 
col))
      {
        if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
            screen_char_2(off, row, col);
***************
*** 2181,2190 ****
      if (row >= screen_Rows || col >= screen_Columns)
        return;
  
-     // Skip if under the popup menu.
-     if (skip_for_popup(row, col))
-       return;
- 
      // Outputting a character in the last cell on the screen may scroll the
      // screen up.  Only do it when the "xn" termcap property is set, otherwise
      // mark the character invalid (update it when scrolled up).
--- 2181,2186 ----
***************
*** 2315,2326 ****
        {
            if (enc_dbcs != 0 && dbcs_off2cells(off + c, max_off) > 1)
            {
!               screen_char_2(off + c, r, c);
                ++c;
            }
            else
            {
!               screen_char(off + c, r, c);
                if (utf_off2cells(off + c, max_off) > 1)
                    ++c;
            }
--- 2311,2324 ----
        {
            if (enc_dbcs != 0 && dbcs_off2cells(off + c, max_off) > 1)
            {
!               if (!skip_for_popup(r, c))
!                   screen_char_2(off + c, r, c);
                ++c;
            }
            else
            {
!               if (!skip_for_popup(r, c))
!                   screen_char(off + c, r, c);
                if (utf_off2cells(off + c, max_off) > 1)
                    ++c;
            }
***************
*** 2486,2496 ****
                    || force_next
  #endif
                    )
- #ifdef FEAT_PROP_POPUP
                    // Skip if under a(nother) popup.
!                   && !blocked_by_popup(row, col)
! #endif
!              )
            {
  #if defined(FEAT_GUI) || defined(UNIX)
                // The bold trick may make a single row of pixels appear in
--- 2484,2491 ----
                    || force_next
  #endif
                    )
                    // Skip if under a(nother) popup.
!                   && !skip_for_popup(row, col))
            {
  #if defined(FEAT_GUI) || defined(UNIX)
                // The bold trick may make a single row of pixels appear in
*** ../vim-9.0.0638/src/version.c       2022-10-02 15:14:40.357455932 +0100
--- src/version.c       2022-10-02 15:07:42.045841272 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     639,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
244. You use more than 20 passwords.

 /// 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/20221002142232.ED79A1C09A3%40moolenaar.net.

Raspunde prin e-mail lui