aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-17 07:04:10 +0800
committerGitHub <noreply@github.com>2024-08-17 07:04:10 +0800
commitd698b3acca9632b68e198c7e7ca9b720c960e969 (patch)
treef04a1f9587ae063b9b697944e1e0b251ed61ef50 /test
parent4afd4061a23c60de26818bc3847e50c791a8f26c (diff)
parenta837f10d17ea13bd97a4e9cc9beba3afb16bf828 (diff)
downloadrneovim-d698b3acca9632b68e198c7e7ca9b720c960e969.tar.gz
rneovim-d698b3acca9632b68e198c7e7ca9b720c960e969.tar.bz2
rneovim-d698b3acca9632b68e198c7e7ca9b720c960e969.zip
Merge pull request #30066 from zeertzjq/vim-9.1.0677
vim-patch: :keepp does not retain last substitute string
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_substitute.vim15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/old/testdir/test_substitute.vim b/test/old/testdir/test_substitute.vim
index f0a25b2804..90c46abe8b 100644
--- a/test/old/testdir/test_substitute.vim
+++ b/test/old/testdir/test_substitute.vim
@@ -806,7 +806,7 @@ func Test_replace_keeppatterns()
a
foobar
-substitute foo asdf
+substitute foo asdf foo
one two
.
@@ -815,21 +815,26 @@ one two
/^substitute
s/foo/bar/
call assert_equal('foo', @/)
- call assert_equal('substitute bar asdf', getline('.'))
+ call assert_equal('substitute bar asdf foo', getline('.'))
/^substitute
keeppatterns s/asdf/xyz/
call assert_equal('^substitute', @/)
- call assert_equal('substitute bar xyz', getline('.'))
+ call assert_equal('substitute bar xyz foo', getline('.'))
+
+ /^substitute
+ &
+ call assert_equal('^substitute', @/)
+ call assert_equal('substitute bar xyz bar', getline('.'))
exe "normal /bar /e\<CR>"
call assert_equal(15, col('.'))
normal -
keeppatterns /xyz
call assert_equal('bar ', @/)
- call assert_equal('substitute bar xyz', getline('.'))
+ call assert_equal('substitute bar xyz bar', getline('.'))
exe "normal 0dn"
- call assert_equal('xyz', getline('.'))
+ call assert_equal('xyz bar', getline('.'))
close!
endfunc