diff options
author | glacambre <code@lacamb.re> | 2019-04-19 07:49:05 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-04-20 10:41:46 +0200 |
commit | b3fd83a0eae2d6353dc72ed62ba32949cc11a1b0 (patch) | |
tree | 7e2ddcbe1a4776fdea7ee4e0abb17fd930c6d1fe /test/functional/terminal/ex_terminal_spec.lua | |
parent | 773bdd41ec19c9909e979c4580cf098d71d168d7 (diff) | |
download | rneovim-b3fd83a0eae2d6353dc72ed62ba32949cc11a1b0.tar.gz rneovim-b3fd83a0eae2d6353dc72ed62ba32949cc11a1b0.tar.bz2 rneovim-b3fd83a0eae2d6353dc72ed62ba32949cc11a1b0.zip |
Reset stop_insert_mode in terminal_enter rather than terminal_check
Problem: Using `:stopinsert` while in normal mode in a terminal buffer
prevents neovim from entering insert mode.
Solution: Move `stop_insert_mode = false` from terminal_check to
terminal_enter to be consistent with edit.c, as suggested by bfredl in
#9889.
Closes https://github.com/neovim/neovim/issues/9889.
Diffstat (limited to 'test/functional/terminal/ex_terminal_spec.lua')
-rw-r--r-- | test/functional/terminal/ex_terminal_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index ca5737db7f..f3849709e3 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -106,6 +106,15 @@ describe(':terminal', function() command('stopinsert') eq({ blocking=false, mode='n' }, 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')) + command(':stopinsert') + eq({ blocking=false, mode='n' }, nvim('get_mode')) + feed('a') + eq({ blocking=false, mode='t' }, nvim('get_mode')) + end) end) describe(':terminal (with fake shell)', function() |