:stopinsert should leave terminal-mode #9856

Problem:  Calling :stopinsert from RPC while in terminal-mode does not
          go back to normal-mode.
Solution: Implement a check() handler for state_enter(), adapted from
          insert_check().

Fix #7807
This commit is contained in:
glacambre
2019-04-08 01:13:43 +02:00
committed by Justin M. Keyes
parent 11bf89e3b5
commit d928b036dc
4 changed files with 26 additions and 4 deletions

View File

@@ -99,6 +99,13 @@ describe(':terminal', function()
eq(3, #jumps)
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'))
end)
end)
describe(':terminal (with fake shell)', function()