mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
vim-patch:8.2.3461: distinguish Normal and Terminal-Normal mode #15878
Problem: Cannot distinguish Normal and Terminal-Normal mode.
Solution: Make mode() return "nt" for Terminal-Normal mode. (issue vim/vim#8856)
72406a4bd2
This commit is contained in:
@@ -96,19 +96,28 @@ describe(':terminal', function()
|
||||
eq(3, #jumps)
|
||||
end)
|
||||
|
||||
it('nvim_get_mode() in :terminal', function()
|
||||
command(':terminal')
|
||||
eq({ blocking=false, mode='nt' }, nvim('get_mode'))
|
||||
feed('i')
|
||||
eq({ blocking=false, mode='t' }, nvim('get_mode'))
|
||||
feed([[<C-\><C-N>]])
|
||||
eq({ blocking=false, mode='nt' }, nvim('get_mode'))
|
||||
end)
|
||||
|
||||
it(':stopinsert RPC request exits terminal-mode #7807', function()
|
||||
command(':terminal')
|
||||
feed('i[tui] insert-mode')
|
||||
eq({ blocking=false, mode='t' }, nvim('get_mode'))
|
||||
command('stopinsert')
|
||||
eq({ blocking=false, mode='n' }, nvim('get_mode'))
|
||||
eq({ blocking=false, mode='nt' }, nvim('get_mode'))
|
||||
end)
|
||||
|
||||
it(':stopinsert in normal mode doesn\'t break insert mode #9889', function()
|
||||
command(':terminal')
|
||||
eq({ blocking=false, mode='n' }, nvim('get_mode'))
|
||||
eq({ blocking=false, mode='nt' }, nvim('get_mode'))
|
||||
command(':stopinsert')
|
||||
eq({ blocking=false, mode='n' }, nvim('get_mode'))
|
||||
eq({ blocking=false, mode='nt' }, nvim('get_mode'))
|
||||
feed('a')
|
||||
eq({ blocking=false, mode='t' }, nvim('get_mode'))
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user