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: #15407
Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
{
// 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);
if (p == NULL)
theline = vim_strnsave(eap->nextcmd, p - eap->nextcmd);
if (*p != NUL)
++p;
+ else
+ p = NULL;
eap->nextcmd = p;
}
else
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 651,
/**/
650,
/**/