aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_ex_mode.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_ex_mode.vim')
-rw-r--r--src/nvim/testdir/test_ex_mode.vim10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim
index 4efdd7c3cd..2b8c5bebea 100644
--- a/src/nvim/testdir/test_ex_mode.vim
+++ b/src/nvim/testdir/test_ex_mode.vim
@@ -64,7 +64,7 @@ func Test_ex_mode()
let &encoding = encoding_save
endfunc
-" Test subsittute confirmation prompt :%s/pat/str/c in Ex mode
+" Test substitute confirmation prompt :%s/pat/str/c in Ex mode
func Test_Ex_substitute()
CheckRunVimInTerminal
let buf = RunVimInTerminal('', {'rows': 6})
@@ -78,6 +78,9 @@ func Test_Ex_substitute()
call WaitForAssert({-> assert_match(' 1 foo foo', term_getline(buf, 5))},
\ 1000)
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000)
+ call term_sendkeys(buf, "N\<CR>")
+ call term_wait(buf)
+ call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000)
call term_sendkeys(buf, "n\<CR>")
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))},
\ 1000)
@@ -86,6 +89,11 @@ func Test_Ex_substitute()
call term_sendkeys(buf, "q\<CR>")
call WaitForAssert({-> assert_match(':', term_getline(buf, 6))}, 1000)
+ " Pressing enter in ex mode should print the current line
+ call term_sendkeys(buf, "\<CR>")
+ call WaitForAssert({-> assert_match(' 3 foo foo',
+ \ term_getline(buf, 5))}, 1000)
+
call term_sendkeys(buf, ":vi\<CR>")
call WaitForAssert({-> assert_match('foo bar', term_getline(buf, 1))}, 1000)