summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-12 11:13:05 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-12 11:13:05 +0100
commit3269efdf014dd3b6e60e330950d40a7cc5d13d3a (patch)
tree267f87e7621db4d7aacc757dcabf2ee2d1df7ad8
parenta34b4460c2843c67a35a2d236b01e6cb9bc38734 (diff)
downloadvim-git-3269efdf014dd3b6e60e330950d40a7cc5d13d3a.tar.gz
patch 8.2.5078: substitute test has a one second delayv8.2.5078
Problem: Substitute test has a one second delay. Solution: Use ":silent!". Add another test case. (closes #10558)
-rw-r--r--src/testdir/test_substitute.vim12
-rw-r--r--src/version.c2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim
index 5061c9726..46ea95513 100644
--- a/src/testdir/test_substitute.vim
+++ b/src/testdir/test_substitute.vim
@@ -469,7 +469,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]
@@ -504,7 +503,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
@@ -535,7 +535,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
@@ -690,10 +691,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
diff --git a/src/version.c b/src/version.c
index f5c0fd7c5..aec6f4b27 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 5078,
+/**/
5077,
/**/
5076,