mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
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:
6a01b3fcc3
b5c0ade437
This commit is contained in:
@@ -361,4 +361,38 @@ describe('ui/cursor', function()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
it(':sleep does not hide cursor when sleeping', function()
|
||||
n.feed(':sleep 100m | echo 42\n')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
:sleep 100m | echo 42 |
|
||||
]],
|
||||
timeout = 100,
|
||||
})
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
42 |
|
||||
]])
|
||||
end)
|
||||
|
||||
it(':sleep! hides cursor when sleeping', function()
|
||||
n.feed(':sleep! 100m | echo 42\n')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|
|
||||
{1:~ }|*3
|
||||
:sleep! 100m | echo 42 |
|
||||
]],
|
||||
timeout = 100,
|
||||
})
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
42 |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user