Skip to content

Commit

Permalink
patch 8.1.0698: clearing the window is used too often
Browse files Browse the repository at this point in the history
Problem:    Clearing the window is used too often, causing the command line
            to be cleared when opening a tab. (Miroslav Koškár)
Solution:   Use NOT_VALID instead of CLEAR.  (suggested by Jason Franklin,
            closes #630)  Also do this for a few other places where clearing
            the screen isn't really needed.
  • Loading branch information
brammool committed Jan 6, 2019
1 parent b328cca commit bf3250a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -799,6 +799,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
698,
/**/
697,
/**/
Expand Down
13 changes: 6 additions & 7 deletions src/window.c
Expand Up @@ -1577,7 +1577,7 @@ win_exchange(long Prenum)
(void)win_comp_pos(); /* recompute window positions */

win_enter(wp, TRUE);
redraw_later(CLEAR);
redraw_all_later(NOT_VALID);
}

/*
Expand Down Expand Up @@ -1660,7 +1660,7 @@ win_rotate(int upwards, int count)
(void)win_comp_pos();
}

redraw_later(CLEAR);
redraw_all_later(NOT_VALID);
}

/*
Expand Down Expand Up @@ -1817,7 +1817,7 @@ win_equal_rec(
frame_new_height(topfr, height, FALSE, FALSE);
topfr->fr_win->w_wincol = col;
frame_new_width(topfr, width, FALSE, FALSE);
redraw_all_later(CLEAR);
redraw_all_later(NOT_VALID);
}
}
else if (topfr->fr_layout == FR_ROW)
Expand Down Expand Up @@ -3702,7 +3702,7 @@ win_new_tabpage(int after)
entering_window(curwin);
#endif

redraw_all_later(CLEAR);
redraw_all_later(NOT_VALID);
apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf);
Expand Down Expand Up @@ -3939,7 +3939,6 @@ enter_tabpage(

last_status(FALSE); /* status line may appear or disappear */
(void)win_comp_pos(); /* recompute w_winrow for all windows */
must_redraw = CLEAR; /* need to redraw everything */
#ifdef FEAT_DIFF
diff_need_scrollbind = TRUE;
#endif
Expand Down Expand Up @@ -3973,7 +3972,7 @@ enter_tabpage(
apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
}

redraw_all_later(CLEAR);

This comment has been minimized.

Copy link
@lifecrisis

lifecrisis Jan 6, 2019

Contributor

It looks like this one may have been a bit too hasty.

I can observe the following problem:

  1. cd vim/src
  2. vim --clean
  3. :tabedit screen.c
  4. @:
  5. gtgt

For me, the screen is now blank when it should show the "screen.c" buffer. Can anyone reproduce this?

It appears that adding the line...

must_redraw = NOT_VALID;

... will fix the issue. I can see that this was added in the neovim adjustment to this function.

This comment has been minimized.

Copy link
@brammool

brammool via email Jan 6, 2019

Author Contributor

This comment has been minimized.

Copy link
@bfredl

bfredl Jan 6, 2019

Contributor

Not sure what function you refer to.

it is this follow-up patch neovim/neovim@6994cc4#diff-40d9eb21ee75b3df148c827ec4d4310aL3337

This comment has been minimized.

Copy link
@brammool

brammool via email Jan 6, 2019

Author Contributor
redraw_all_later(NOT_VALID);
}

/*
Expand Down Expand Up @@ -6569,7 +6568,7 @@ restore_snapshot(
win_comp_pos();
if (wp != NULL && close_curwin)
win_goto(wp);
redraw_all_later(CLEAR);
redraw_all_later(NOT_VALID);
}
clear_snapshot(curtab, idx);
}
Expand Down

0 comments on commit bf3250a

Please sign in to comment.