diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-05-06 16:40:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-05-06 16:40:16 +0200 |
commit | 6eddadff13164b98fe8198153cc656897b2cbcb3 (patch) | |
tree | ee5f8b946b47fcb83f719b52f16b1e06d8cd6bcc /src/screen.c | |
parent | 231a2db1b372fe9645505e711ac53b9ee748c535 (diff) | |
download | vim-git-6eddadff13164b98fe8198153cc656897b2cbcb3.tar.gz |
patch 8.0.1797: terminal window is redrawn too oftenv8.0.1797
Problem: Terminal window is redrawn too often and scrolling is repeated.
Solution: Don't scroll immediately but only when redrawing. Avoid redrawing
the whole terminal window on every change.
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/screen.c b/src/screen.c index 06dc30439..cff6ae5d3 100644 --- a/src/screen.c +++ b/src/screen.c @@ -567,8 +567,12 @@ update_screen(int type_arg) must_redraw = 0; } - /* Need to update w_lines[]. */ - if (curwin->w_lines_valid == 0 && type < NOT_VALID) + /* May need to update w_lines[]. */ + if (curwin->w_lines_valid == 0 && type < NOT_VALID +#ifdef FEAT_TERMINAL + && !term_do_update_window(curwin) +#endif + ) type = NOT_VALID; /* Postpone the redrawing when it's not needed and when being called @@ -1172,10 +1176,10 @@ win_update(win_T *wp) } #ifdef FEAT_TERMINAL - /* If this window contains a terminal, redraw works completely differently. - */ - if (term_update_window(wp) == OK) + // If this window contains a terminal, redraw works completely differently. + if (term_do_update_window(wp)) { + term_update_window(wp); # ifdef FEAT_MENU /* Draw the window toolbar, if there is one. */ if (winbar_height(wp) > 0) |