aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-12 18:22:29 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-06-12 20:42:30 +0800
commit8bc48273eb9629409c26b811d6c8a7025f53a3cf (patch)
treec465269d9974a6e6211a6ce4ada56659e22529de /src
parent41bb81a2dfe3c173a5d8f9d7c200475028221cf3 (diff)
downloadrneovim-8bc48273eb9629409c26b811d6c8a7025f53a3cf.tar.gz
rneovim-8bc48273eb9629409c26b811d6c8a7025f53a3cf.tar.bz2
rneovim-8bc48273eb9629409c26b811d6c8a7025f53a3cf.zip
vim-patch:8.2.5078: substitute test has a one second delay
Problem: Substitute test has a one second delay. Solution: Use ":silent!". Add another test case. (closes vim/vim#10558) https://github.com/vim/vim/commit/3269efdf014dd3b6e60e330950d40a7cc5d13d3a
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_substitute.vim12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim
index 7a15e9a6f1..979c4a70bc 100644
--- a/src/nvim/testdir/test_substitute.vim
+++ b/src/nvim/testdir/test_substitute.vim
@@ -152,7 +152,6 @@ func Run_SubCmd_Tests(tests)
for t in a:tests
let start = line('.') + 1
let end = start + len(t[2]) - 1
- " TODO: why is there a one second delay the first time we get here?
exe "normal o" . t[0]
call cursor(start, 1)
exe t[1]
@@ -187,7 +186,8 @@ func Test_sub_cmd_1()
\ ['sSs', 's/S/\c/', ['scs']],
\ ['tTt', "s/T/\<C-V>\<C-J>/", ["t\<C-V>\<C-J>t"]],
\ ['U', 's/U/\L\uuUu\l\EU/', ['UuuU']],
- \ ['V', 's/V/\U\lVvV\u\Ev/', ['vVVv']]
+ \ ['V', 's/V/\U\lVvV\u\Ev/', ['vVVv']],
+ \ ['\', 's/\\/\\\\/', ['\\']]
\ ]
call Run_SubCmd_Tests(tests)
endfunc
@@ -218,7 +218,8 @@ func Test_sub_cmd_2()
\ ['sSs', 's/S/\c/', ['scs']],
\ ['tTt', "s/T/\<C-V>\<C-J>/", ["t\<C-V>\<C-J>t"]],
\ ['U', 's/U/\L\uuUu\l\EU/', ['UuuU']],
- \ ['V', 's/V/\U\lVvV\u\Ev/', ['vVVv']]
+ \ ['V', 's/V/\U\lVvV\u\Ev/', ['vVVv']],
+ \ ['\', 's/\\/\\\\/', ['\\']]
\ ]
call Run_SubCmd_Tests(tests)
endfunc
@@ -672,10 +673,11 @@ func Test_nocatch_sub_failure_handling()
endfunc
new
call setline(1, ['1 aaa', '2 aaa', '3 aaa'])
- %s/aaa/\=Foo()/g
+ " need silent! to avoid a delay when entering Insert mode
+ silent! %s/aaa/\=Foo()/g
call assert_equal(['1 0', '2 0', '3 0'], getline(1, 3))
- " Trow without try-catch causes abort after the first line.
+ " Throw without try-catch causes abort after the first line.
" We cannot test this, since it would stop executing the test script.
" try/catch does not result in any changes