Patch 8.2.1995

3 views
Skip to first unread message

Bram Moolenaar

unread,
Nov 16, 2020, 1:12:38 PM11/16/20
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages