patch 8.2.2754: :sleep! does not always hide the cursor
Problem: :sleep! does not always hide the cursor.
Solution: Add the cursor_is_asleep flag. (Jeremy Lerner, closes #8097,
closes #7998)
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 0e36e79..7df4a96 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -297,7 +297,9 @@
// Remove the cursor before starting to do anything, because
// scrolling may make it difficult to redraw the text under
// it.
- if (gui.in_use && wp == curwin)
+ // Also remove the cursor if it needs to be hidden due to an
+ // ongoing cursor-less sleep.
+ if (gui.in_use && (wp == curwin || cursor_is_sleeping()))
{
gui_cursor_col = gui.cursor_col;
gui_cursor_row = gui.cursor_row;
@@ -306,7 +308,6 @@
}
}
#endif
-
win_update(wp);
}