aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/nvim/ex_cmds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index f170fd0762..1060650bf2 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2781,7 +2781,7 @@ void ex_append(exarg_T *eap)
} else if (eap->ea_getline == NULL) {
// No getline() function, use the lines that follow. This ends
// when there is no more.
- if (eap->nextcmd == NULL || *eap->nextcmd == NUL) {
+ if (eap->nextcmd == NULL) {
break;
}
p = vim_strchr(eap->nextcmd, NL);
@@ -2791,6 +2791,8 @@ void ex_append(exarg_T *eap)
theline = xmemdupz(eap->nextcmd, (size_t)(p - eap->nextcmd));
if (*p != NUL) {
p++;
+ } else {
+ p = NULL;
}
eap->nextcmd = p;
} else {