aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/state.c2
-rw-r--r--src/nvim/testdir/test_functions.vim8
2 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c
index 04271d750c..4eb0073873 100644
--- a/src/nvim/state.c
+++ b/src/nvim/state.c
@@ -195,6 +195,8 @@ char *get_mode(void)
|| restart_edit == 'V') {
buf[1] = 'i';
buf[2] = (char)restart_edit;
+ } else if (curbuf->terminal) {
+ buf[1] = 't';
}
}
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 366615821c..ed080afee6 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -710,6 +710,14 @@ func Test_mode()
call assert_equal('c-cv', g:current_modes)
" How to test Ex mode?
+ if has('terminal')
+ term
+ call feedkeys("\<C-W>N", 'xt')
+ call assert_equal('n', mode())
+ call assert_equal('nt', mode(1))
+ call feedkeys("aexit\<CR>", 'xt')
+ endif
+
bwipe!
iunmap <F2>
xunmap <F2>