From 4817547ec4630c2af2c94ade07bbf220992ad0d7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 7 Dec 2024 21:42:44 +0800 Subject: feat(ex_cmds): :sleep! hides the cursor while sleeping (#31493) Problem: :sleep! not hiding the cursor is an arbitrary difference from Vim without obvious justification, and Vim's behavior isn't easily achievable in Nvim. Solution: Make :sleep! hide the cursor while sleeping. Ref: https://github.com/neovim/neovim/commit/6a01b3fcc361960e559db459e1524418bc76dd66 https://github.com/neovim/neovim/commit/b5c0ade43790cf18f6a54858ddad30d8d9667cf9 --- src/nvim/ex_docmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index b7c83ea1ac..b32a8b867f 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6101,7 +6101,9 @@ static void ex_sleep(exarg_T *eap) default: semsg(_(e_invarg2), eap->arg); return; } - do_sleep(len, false); + + // Hide the cursor if invoked with ! + do_sleep(len, eap->forceit); } /// Sleep for "msec" milliseconds, but return early on CTRL-C. -- cgit