summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-01 17:13:36 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-01 17:13:36 +0200
commitbf0eff0b724ebf4951f7ca82e6c648451f9f0c01 (patch)
tree3be6478692b535abb96b8fe3963137e15581b206 /src/screen.c
parent2d247849ce612050ba1085df806746b23be1f0a3 (diff)
downloadvim-git-bf0eff0b724ebf4951f7ca82e6c648451f9f0c01.tar.gz
patch 8.1.1441: popup window filter not yet implementedv8.1.1441
Problem: Popup window filter not yet implemented. Solution: Implement the popup filter.
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/src/screen.c b/src/screen.c
index 5f3947bf9..a8b10dedb 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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