0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.2366: when using ":sleep" the cursor is always displayed

Problem:    When using ":sleep" the cursor is always displayed.
Solution:   Do not display the cursor when using ":sleep!". (Jeremy Lerner,
            closes #7688)
This commit is contained in:
Bram Moolenaar
2021-01-16 20:21:23 +01:00
parent 70250fb4d2
commit e2edc2ed4a
10 changed files with 49 additions and 10 deletions

View File

@@ -7225,14 +7225,17 @@ ex_sleep(exarg_T *eap)
case NUL: len *= 1000L; break;
default: semsg(_(e_invarg2), eap->arg); return;
}
do_sleep(len);
// Hide the cursor if invoked with !
do_sleep(len, eap->forceit);
}
/*
* Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second.
* Hide the cursor if "hide_cursor" is TRUE.
*/
void
do_sleep(long msec)
do_sleep(long msec, int hide_cursor)
{
long done = 0;
long wait_now;
@@ -7244,7 +7247,11 @@ do_sleep(long msec)
ELAPSED_INIT(start_tv);
# endif
cursor_on();
if (hide_cursor)
cursor_off();
else
cursor_on();
out_flush_cursor(FALSE, FALSE);
while (!got_int && done < msec)
{