win_T *wp,
linenr_T lnum)
{
- if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
- wp->w_redraw_top = lnum;
- if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
- wp->w_redraw_bot = lnum;
- redraw_win_later(wp, UPD_VALID);
+ redraw_win_range_later(wp, lnum, lnum);
+}
+
+ void
+redraw_win_range_later(
+ win_T *wp,
+ linenr_T first,
+ linenr_T last)
+{
+ if (last >= wp->w_topline && first < wp->w_botline)
+ {
+ if (wp->w_redraw_top == 0 || wp->w_redraw_top > first)
+ wp->w_redraw_top = first;
+ if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < last)
+ wp->w_redraw_bot = last;
+ redraw_win_later(wp, UPD_VALID);
+ }
}
// this in other situations, the changed lines will be redrawn anyway and
// this method can cause the whole window to be updated.
if (end != bot)
- {
- if (wp->w_redraw_top == 0 || wp->w_redraw_top > top)
- wp->w_redraw_top = top;
- if (wp->w_redraw_bot < end)
- wp->w_redraw_bot = end;
- }
+ redraw_win_range_later(wp, top, end);
invalid_top = (linenr_T)0;
}
// Calculate top and bottom lines for redrawing area
if (toplnum != 0)
{
- if (wp->w_buffer->b_mod_set)
- {
- if (wp->w_buffer->b_mod_top > toplnum)
- wp->w_buffer->b_mod_top = toplnum;
- if (wp->w_buffer->b_mod_bot < botlnum)
- wp->w_buffer->b_mod_bot = botlnum;
- }
- else
- {
- wp->w_buffer->b_mod_set = TRUE;
- wp->w_buffer->b_mod_top = toplnum;
- wp->w_buffer->b_mod_bot = botlnum;
- wp->w_buffer->b_mod_xlines = 0;
- }
+ redraw_win_range_later(wp, toplnum, botlnum);
m->mit_toplnum = toplnum;
m->mit_botlnum = botlnum;
rtype = UPD_VALID;
vim_free(cur->mit_pattern);
if (cur->mit_toplnum != 0)
{
- if (wp->w_buffer->b_mod_set)
- {
- if (wp->w_buffer->b_mod_top > cur->mit_toplnum)
- wp->w_buffer->b_mod_top = cur->mit_toplnum;
- if (wp->w_buffer->b_mod_bot < cur->mit_botlnum)
- wp->w_buffer->b_mod_bot = cur->mit_botlnum;
- }
- else
- {
- wp->w_buffer->b_mod_set = TRUE;
- wp->w_buffer->b_mod_top = cur->mit_toplnum;
- wp->w_buffer->b_mod_bot = cur->mit_botlnum;
- wp->w_buffer->b_mod_xlines = 0;
- }
+ redraw_win_range_later(wp, cur->mit_toplnum, cur->mit_botlnum);
rtype = UPD_VALID;
}
vim_free(cur->mit_pos_array);
void redraw_statuslines(void);
void win_redraw_last_status(frame_T *frp);
void redrawWinline(win_T *wp, linenr_T lnum);
+void redraw_win_range_later(win_T *wp, linenr_T first, linenr_T last);
/* vim: set ft=c : */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1136,
/**/
1135,
/**/