summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-01-31 20:51:47 +0100
committerBram Moolenaar <Bram@vim.org>2018-01-31 20:51:47 +0100
commita338adcf222b6a24e26ea5ae6a2ad27f914acb38 (patch)
tree0ffe28d0a3a60c2c1444a991514505c448d4335b /src/main.c
parent37badc898b8d167e11553b6d05908ffd35928a6e (diff)
downloadvim-git-a338adcf222b6a24e26ea5ae6a2ad27f914acb38.tar.gz
patch 8.0.1449: slow redrawing with DirectXv8.0.1449
Problem: Slow redrawing with DirectX. Solution: Avoid calling gui_mch_flush() unnecessarily, especially when updating the cursor. (Ken Takata, closes #2560)
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 877adaf5b..9cf10bd78 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1242,7 +1242,11 @@ main_loop(
if (VIsual_active)
update_curbuf(INVERTED);/* update inverted part */
else if (must_redraw)
+ {
+ mch_disable_flush(); /* Stop issuing gui_mch_flush(). */
update_screen(0);
+ mch_enable_flush();
+ }
else if (redraw_cmdline || clear_cmdline)
showmode();
redraw_statuslines();
@@ -1283,11 +1287,13 @@ main_loop(
|| conceal_cursor_line(curwin)
|| need_cursor_line_redraw))
{
+ mch_disable_flush(); /* Stop issuing gui_mch_flush(). */
if (conceal_old_cursor_line != conceal_new_cursor_line
&& conceal_old_cursor_line
<= curbuf->b_ml.ml_line_count)
update_single_line(curwin, conceal_old_cursor_line);
update_single_line(curwin, conceal_new_cursor_line);
+ mch_enable_flush();
curwin->w_valid &= ~VALID_CROW;
}
# endif
@@ -4212,11 +4218,7 @@ eval_client_expr_to_string(char_u *expr)
/* A client can tell us to redraw, but not to display the cursor, so do
* that here. */
setcursor();
- out_flush();
-#ifdef FEAT_GUI
- if (gui.in_use)
- gui_update_cursor(FALSE, FALSE);
-#endif
+ out_flush_cursor(FALSE, FALSE);
return res;
}