patch 9.1.0573: ex: no implicit print for single addresses

Commit: 
https://github.com/vim/vim/commit/c25a7084e9ae1f78c28ddcbe1fa23374cfdf1e03
Author: Mohamed Akram <mohd.ak...@outlook.com>
Date:   Fri Jul 12 20:17:55 2024 +0200

    patch 9.1.0573: ex: no implicit print for single addresses
    
    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.ak...@outlook.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index 8c07fbf53..8b536055a 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -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
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1dc28bc66..7ab1c69e5 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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
diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim
index 6969d5ec0..b0e5d81a8 100644
--- a/src/testdir/test_ex_mode.vim
+++ b/src/testdir/test_ex_mode.vim
@@ -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('
')->join(' '))
+  call assert_equal('three', b->split('
')->join(' '))
+  bw!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/testdir/test_paste.vim b/src/testdir/test_paste.vim
index d079f48f9..b35fc8123 100644
--- a/src/testdir/test_paste.vim
+++ b/src/testdir/test_paste.vim
@@ -93,7 +93,7 @@ func Test_paste_ex_mode()
   call assert_equal("foo
bar", 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()
diff --git a/src/version.c b/src/version.c
index fc1fb24ea..a4ae10f20 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    573,
 /**/
     572,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sSL1v-002Udz-GZ%40256bit.org.

Raspunde prin e-mail lui