Problem: ex: no implicit print for single addresses
Solution: explicitly print even during single addresses,
as requested by POSIX (Mohamed Akram)
See the POSIX behaviour here:
https://pubs.opengroup.org/onlinepubs/
9699919799/utilities/ex.html#tag_20_40_13_03
Section 6b
closes: #15230
Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
*:[range]*
:[range] Set the cursor on the last line number in [range].
+ In Ex mode, print the lines in [range].
[range] can also be just one line number, e.g., ":1"
or ":'m".
In contrast with |G| this command does not modify the
{
char *errormsg = NULL;
- if ((*eap->cmd == '|' || (exmode_active && eap->line1 != eap->line2))
+ if ((*eap->cmd == '|' || exmode_active)
#ifdef FEAT_EVAL
&& !in_vim9script()
#endif
call assert_equal(['X \\', "Y"], getline(1, 2))
endfunc
+" Testing implicit print command
+func Test_implicit_print()
+ new
+ call setline(1, ['one', 'two', 'three'])
+ call feedkeys('Q:let a=execute(":1,2")', 'xt')
+ call feedkeys('Q:let b=execute(":3")', 'xt')
+ call assert_equal('one two', a->split('\n')->join(' '))
+ call assert_equal('three', b->split('\n')->join(' '))
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
call assert_equal("foo\rbar", foo)
" pasting more than 40 bytes
- exe "norm Q\<PasteStart>0000000000000000000000000000000000000000000000000000000000000000000000\<C-C>"
+ exe "norm Q\<PasteStart>s/.*/0000000000000000000000000000000000000000000000000000000000000000/\<C-C>"
endfunc
func Test_paste_onechar()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 573,
/**/
572,
/**/