0
0
mirror of https://github.com/vim/vim.git synced 2025-10-07 05:54:16 -04:00

patch 8.1.1441: popup window filter not yet implemented

Problem:    Popup window filter not yet implemented.
Solution:   Implement the popup filter.
This commit is contained in:
Bram Moolenaar
2019-06-01 17:13:36 +02:00
parent 2d247849ce
commit bf0eff0b72
12 changed files with 227 additions and 56 deletions

View File

@@ -996,48 +996,19 @@ update_debug_sign(buf_T *buf, linenr_T lnum)
update_popups(void)
{
win_T *wp;
win_T *lowest_wp;
int lowest_zindex;
// Reset all the VALID_POPUP flags.
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
wp->w_popup_flags &= ~POPF_REDRAWN;
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
wp->w_popup_flags &= ~POPF_REDRAWN;
// Find the window with the lowest zindex that hasn't been updated yet,
// so that the window with a higher zindex is drawn later, thus goes on
// top.
// TODO: don't redraw every popup every time.
for (;;)
popup_reset_handled();
while ((wp = find_next_popup(TRUE)) != NULL)
{
// Find the window with the lowest zindex that hasn't been updated yet,
// so that the window with a higher zindex is drawn later, thus goes on
// top.
lowest_zindex = INT_MAX;
lowest_wp = NULL;
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
if ((wp->w_popup_flags & (POPF_REDRAWN|POPF_HIDDEN)) == 0
&& wp->w_zindex < lowest_zindex)
{
lowest_zindex = wp->w_zindex;
lowest_wp = wp;
}
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
if ((wp->w_popup_flags & (POPF_REDRAWN|POPF_HIDDEN)) == 0
&& wp->w_zindex < lowest_zindex)
{
lowest_zindex = wp->w_zindex;
lowest_wp = wp;
}
if (lowest_wp == NULL)
break;
// Recompute the position if the text changed.
if (lowest_wp->w_popup_last_changedtick
!= CHANGEDTICK(lowest_wp->w_buffer))
popup_adjust_position(lowest_wp);
if (wp->w_popup_last_changedtick != CHANGEDTICK(wp->w_buffer))
popup_adjust_position(wp);
win_update(lowest_wp);
lowest_wp->w_popup_flags |= POPF_REDRAWN;
win_update(wp);
}
}
#endif