patch 8.0.1496: clearing a pointer takes two lines
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
diff --git a/src/term.c b/src/term.c
index 6303e10..1f17d9f 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2502,7 +2502,8 @@
}
/*
- * out_flush_cursor(): flush the output buffer and redraw the cursor
+ * out_flush_cursor(): flush the output buffer and redraw the cursor.
+ * Does not flush recursively in the GUI to avoid slow drawing.
*/
void
out_flush_cursor(
@@ -3912,8 +3913,7 @@
{
while (tc_len > 0)
vim_free(termcodes[--tc_len].code);
- vim_free(termcodes);
- termcodes = NULL;
+ VIM_CLEAR(termcodes);
tc_max_len = 0;
#ifdef HAVE_TGETENT
@@ -5648,7 +5648,7 @@
/* Work out our pseudo mouse event. Note that MOUSE_RELEASE gets
* added, then it's not mouse up/down. */
key_name[0] = (int)KS_EXTRA;
- if (wheel_code != 0
+ if (wheel_code != 0
&& (wheel_code & MOUSE_RELEASE) != MOUSE_RELEASE)
{
if (wheel_code & MOUSE_CTRL)