summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-16 20:21:23 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-16 20:21:23 +0100
commite2edc2ed4a9a229870b1e1811b0ecf045b84e429 (patch)
tree52eb7e738360094d273506de9f81427de4ff0913 /src/ex_docmd.c
parent70250fb4d2ffc2e92db224c6374db418f70691fd (diff)
downloadvim-git-e2edc2ed4a9a229870b1e1811b0ecf045b84e429.tar.gz
patch 8.2.2366: when using ":sleep" the cursor is always displayedv8.2.2366
Problem: When using ":sleep" the cursor is always displayed. Solution: Do not display the cursor when using ":sleep!". (Jeremy Lerner, closes #7688)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 7fe33d8e5..9562e6be3 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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)
{