From d928b036dc2be8f043545c0d7e2a2b2285528aaa Mon Sep 17 00:00:00 2001 From: glacambre Date: Mon, 8 Apr 2019 01:13:43 +0200 Subject: :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 --- test/functional/terminal/ex_terminal_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index dbee9bdb49..ca5737db7f 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -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() -- cgit