File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ void terminal_enter(void)
374
374
TerminalState state , * s = & state ;
375
375
memset (s , 0 , sizeof (TerminalState ));
376
376
s -> term = buf -> terminal ;
377
+ stop_insert_mode = false;
377
378
378
379
// Ensure the terminal is properly sized. Ideally window size management
379
380
// code should always have resized the terminal already, but check here to
@@ -435,7 +436,6 @@ void terminal_enter(void)
435
436
static int terminal_check (VimState * state )
436
437
{
437
438
if (stop_insert_mode ) {
438
- stop_insert_mode = false;
439
439
return 0 ;
440
440
}
441
441
return 1 ;
Original file line number Diff line number Diff line change @@ -106,6 +106,15 @@ describe(':terminal', function()
106
106
command (' stopinsert' )
107
107
eq ({ blocking = false , mode = ' n' }, nvim (' get_mode' ))
108
108
end )
109
+
110
+ it (' :stopinsert in normal mode doesn\' t break insert mode #9889' , function ()
111
+ command (' :terminal' )
112
+ eq ({ blocking = false , mode = ' n' }, nvim (' get_mode' ))
113
+ command (' :stopinsert' )
114
+ eq ({ blocking = false , mode = ' n' }, nvim (' get_mode' ))
115
+ feed (' a' )
116
+ eq ({ blocking = false , mode = ' t' }, nvim (' get_mode' ))
117
+ end )
109
118
end )
110
119
111
120
describe (' :terminal (with fake shell)' , function ()
You can’t perform that action at this time.
0 commit comments