diff src/term.c @ 13150:808625d4b71b v8.0.1449

patch 8.0.1449: slow redrawing with DirectX commit https://github.com/vim/vim/commit/a338adcf222b6a24e26ea5ae6a2ad27f914acb38 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 31 20:51:47 2018 +0100 patch 8.0.1449: slow redrawing with DirectX Problem: Slow redrawing with DirectX. Solution: Avoid calling gui_mch_flush() unnecessarily, especially when updating the cursor. (Ken Takata, closes #2560)
author Christian Brabandt <cb@256bit.org>
date Wed, 31 Jan 2018 21:00:08 +0100
parents e775011b4c1e
children ac42c4b11dbc
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -2501,6 +2501,27 @@ out_flush(void)
     }
 }
 
+/*
+ * out_flush_cursor(): flush the output buffer and redraw the cursor
+ */
+    void
+out_flush_cursor(
+    int	    force UNUSED,   /* when TRUE, update cursor even when not moved */
+    int	    clear_selection UNUSED) /* clear selection under cursor */
+{
+    mch_disable_flush();
+    out_flush();
+    mch_enable_flush();
+#ifdef FEAT_GUI
+    if (gui.in_use)
+    {
+	gui_update_cursor(force, clear_selection);
+	gui_may_flush();
+    }
+#endif
+}
+
+
 #if defined(FEAT_MBYTE) || defined(PROTO)
 /*
  * Sometimes a byte out of a multi-byte character is written with out_char().