aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-02 07:52:09 +0800
committerGitHub <noreply@github.com>2024-08-02 07:52:09 +0800
commitb782a37cf58b5ae5e47fd15fb2a5096639c64a23 (patch)
tree9a280eb4f37185f774534a67b8781d38e9d2caaf /test
parentac15db4b9c21b51dc1789c4c75bd8cb363c6715d (diff)
downloadrneovim-b782a37cf58b5ae5e47fd15fb2a5096639c64a23.tar.gz
rneovim-b782a37cf58b5ae5e47fd15fb2a5096639c64a23.tar.bz2
rneovim-b782a37cf58b5ae5e47fd15fb2a5096639c64a23.zip
vim-patch:9.1.0651: ex: trailing dot is optional for :g and :insert/:append (#29946)
Problem: ex: trailing dot is optional for :g and :insert/:append Solution: don't break out early, when the next command is empty. (Mohamed Akram) The terminating period is optional for the last command in a global command list. closes: vim/vim#15407 https://github.com/vim/vim/commit/0214680a8ec5f7f656cb42e5db19243709202ed2 Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
Diffstat (limited to 'test')
-rw-r--r--test/functional/ex_cmds/append_spec.lua2
-rw-r--r--test/old/testdir/test_ex_mode.vim9
2 files changed, 10 insertions, 1 deletions
diff --git a/test/functional/ex_cmds/append_spec.lua b/test/functional/ex_cmds/append_spec.lua
index 80fdcb3134..df62aecc7f 100644
--- a/test/functional/ex_cmds/append_spec.lua
+++ b/test/functional/ex_cmds/append_spec.lua
@@ -23,7 +23,7 @@ local cmdtest = function(cmd, prep, ret1)
end
it(cmd .. 's' .. prep .. ' the current line by default', function()
- command(cmd .. '\nabc\ndef\n')
+ command(cmd .. '\nabc\ndef')
eq(ret1, buffer_contents())
end)
-- Used to crash because this invokes history processing which uses
diff --git a/test/old/testdir/test_ex_mode.vim b/test/old/testdir/test_ex_mode.vim
index f55ba87a3e..9f3ee2194e 100644
--- a/test/old/testdir/test_ex_mode.vim
+++ b/test/old/testdir/test_ex_mode.vim
@@ -307,4 +307,13 @@ func Test_insert_after_trailing_bar()
bwipe!
endfunc
+" Test global insert of a newline without terminating period
+func Test_global_insert_newline()
+ new
+ call setline(1, ['foo'])
+ call feedkeys("Qg/foo/i\\\n", "xt")
+ call assert_equal(['', 'foo'], getline(1, '$'))
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab