]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0573: ex: no implicit print for single addresses v9.1.0573
authorMohamed Akram <mohd.akram@outlook.com>
Fri, 12 Jul 2024 18:17:55 +0000 (20:17 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 12 Jul 2024 18:18:54 +0000 (20:18 +0200)
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>
runtime/doc/motion.txt
src/ex_docmd.c
src/testdir/test_ex_mode.vim
src/testdir/test_paste.vim
src/version.c

index 8c07fbf53ef0cf4bb67a471f125e0541294773d3..8b536055a7c852edb1a65c6b240710995b32a756 100644 (file)
@@ -351,6 +351,7 @@ gg                  Goto line [count], default first line, on the first
 
                                                        *:[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
index 1dc28bc668e981db8aab134a158eda76c7b93fcd..7ab1c69e526c3a5ec2472db866be68fe298d1ae1 100644 (file)
@@ -2730,7 +2730,7 @@ ex_range_without_command(exarg_T *eap)
 {
     char *errormsg = NULL;
 
-    if ((*eap->cmd == '|' || (exmode_active && eap->line1 != eap->line2))
+    if ((*eap->cmd == '|' || exmode_active)
 #ifdef FEAT_EVAL
            && !in_vim9script()
 #endif
index 6969d5ec046957ececd132ca31fd197e652db5f7..b0e5d81a82a6e3068372c7f4846bd34b3930bdbc 100644 (file)
@@ -353,4 +353,15 @@ func Test_backslash_multiline2()
   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
index d079f48f9253f4c4007d5b7651d11117a96de928..b35fc8123dcdf7d5fe2d4bb1e95497777729fba3 100644 (file)
@@ -93,7 +93,7 @@ func Test_paste_ex_mode()
   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()
index fc1fb24eac2c9089ae0048e856ca4b346550c81d..a4ae10f20817139df23513307d741898357cd079 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    573,
 /**/
     572,
 /**/