mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ui: add tests for new cursor shape modes
This commit is contained in:
@@ -566,119 +566,6 @@ describe('Screen', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('mode change', function()
|
||||
before_each(function()
|
||||
screen:try_resize(25, 5)
|
||||
end)
|
||||
|
||||
it('works in normal mode', function()
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]],nil,nil,function ()
|
||||
eq("normal", screen.mode)
|
||||
end)
|
||||
end)
|
||||
|
||||
it('works in insert mode', function()
|
||||
feed('i')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{2:-- INSERT --} |
|
||||
]],nil,nil,function ()
|
||||
eq("insert", screen.mode)
|
||||
end)
|
||||
|
||||
feed('word<esc>')
|
||||
screen:expect([[
|
||||
wor^d |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]], nil, nil, function ()
|
||||
eq("normal", screen.mode)
|
||||
end)
|
||||
end)
|
||||
|
||||
it('works in replace mode', function()
|
||||
feed('R')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{2:-- REPLACE --} |
|
||||
]], nil, nil, function ()
|
||||
eq("replace", screen.mode)
|
||||
end)
|
||||
|
||||
feed('word<esc>')
|
||||
screen:expect([[
|
||||
wor^d |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]], nil, nil, function ()
|
||||
eq("normal", screen.mode)
|
||||
end)
|
||||
end)
|
||||
|
||||
it('works in cmdline mode', function()
|
||||
feed(':')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
:^ |
|
||||
]],nil,nil,function ()
|
||||
eq("cmdline", screen.mode)
|
||||
end)
|
||||
|
||||
feed('<esc>/')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
/^ |
|
||||
]],nil,nil,function ()
|
||||
eq("cmdline", screen.mode)
|
||||
end)
|
||||
|
||||
|
||||
feed('<esc>?')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
?^ |
|
||||
]],nil,nil,function ()
|
||||
eq("cmdline", screen.mode)
|
||||
end)
|
||||
|
||||
feed('<esc>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]],nil,nil,function ()
|
||||
eq("normal", screen.mode)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
it('nvim_ui_attach() handles very large width/height #2180', function()
|
||||
screen:detach()
|
||||
screen = Screen.new(999, 999)
|
||||
|
||||
Reference in New Issue
Block a user