Patch 8.2.1995
Problem:    The popup menu can cause too much redrawing.
Solution:   Reduce the length of the displayed text. (Yasuhiro Matsumoto,
            closes #7306)
Files:      src/popupmenu.c


*** ../vim-8.2.1994/src/popupmenu.c     2020-11-15 14:09:34.100728303 +0100
--- src/popupmenu.c     2020-11-16 18:59:34.945148035 +0100
***************
*** 361,366 ****
--- 361,368 ----
        // redo the positioning.  Limit this to two times, when there is not
        // much room the window size will keep changing.
      } while (pum_set_selected(selected, redo_count) && ++redo_count <= 2);
+ 
+     pum_redraw();
  }
  
  /*
***************
*** 541,548 ****
                        {
                            if (st != NULL)
                            {
!                               screen_puts_len(st, (int)STRLEN(st), row, col,
!                                                                       attr);
                                vim_free(st);
                            }
                            col += width;
--- 543,565 ----
                        {
                            if (st != NULL)
                            {
!                               int size = (int)STRLEN(st);
!                               int cells = (*mb_string2cells)(st, size);
! 
!                               // only draw the text that fits
!                               while (size > 0
!                                         && col + cells > pum_width + pum_col)
!                               {
!                                   --size;
!                                   if (has_mbyte)
!                                   {
!                                       size -= (*mb_head_off)(st, st + size);
!                                       cells -= (*mb_ptr2cells)(st + size);
!                                   }
!                                   else
!                                       --cells;
!                               }
!                               screen_puts_len(st, size, row, col, attr);
                                vim_free(st);
                            }
                            col += width;
***************
*** 990,998 ****
        popup_hide_info();
  #endif
  
-     if (!resized)
-       pum_redraw();
- 
      return resized;
  }
  
--- 1007,1012 ----
*** ../vim-8.2.1994/src/version.c       2020-11-16 18:49:43.989459018 +0100
--- src/version.c       2020-11-16 19:01:32.284940675 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1995,
  /**/

-- 
Did you hear about the new 3 million dollar West Virginia State Lottery?
The winner gets 3 dollars a year for a million years.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202011161812.0AGICPBl1227363%40masaka.moolenaar.net.

Raspunde prin e-mail lui