mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.1814: a long title in a popup window overflows
Problem: A long title in a popup window overflows. Solution: Truncate the title. (closes #4770)
This commit is contained in:
@@ -2969,8 +2969,14 @@ update_popups(void (*win_update)(win_T *wp))
|
||||
|
||||
// Title goes on top of border or padding.
|
||||
if (wp->w_popup_title != NULL)
|
||||
screen_puts(wp->w_popup_title, wp->w_winrow, wp->w_wincol + 1,
|
||||
{
|
||||
int len = (int)STRLEN(wp->w_popup_title) + 1;
|
||||
char_u *title = alloc(len);
|
||||
|
||||
trunc_string(wp->w_popup_title, title, total_width - 2, len);
|
||||
screen_puts(title, wp->w_winrow, wp->w_wincol + 1,
|
||||
wp->w_popup_border[0] > 0 ? border_attr[0] : popup_attr);
|
||||
}
|
||||
|
||||
// Compute scrollbar thumb position and size.
|
||||
if (wp->w_has_scrollbar)
|
||||
|
Reference in New Issue
Block a user