patch 9.1.2126: vim --version used single column for feature list

Commit: 
https://github.com/vim/vim/commit/65c5b8e7d0323eedfc47e86c41c361ef63510c32
Author: Hirohito Higashi <[email protected]>
Date:   Mon Feb 2 10:08:10 2026 +0000

    patch 9.1.2126: vim --version used single column for feature list
    
    Problem:  vim --version used single column for feature list
              (Ben Knoble, after v9.1.1898)
    Solution: Restore old behaviour and assume 80 columns, making sure
              the feature list is shown in several columns
              (Ben Knoble, Hirohito Higashi).
    
    fixes:  #19309
    closes: #19315
    
    Co-authored-by: D. Ben Knoble <[email protected]>
    Signed-off-by: Hirohito Higashi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/main.c b/src/main.c
index 5ae94e43e..c31b14d0c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2181,7 +2181,7 @@ command_line_scan(mparm_T *parmp)
                    usage();
                else if (STRICMP(argv[0] + argv_idx, "version") == 0)
                {
-                   Columns = 80;       // need to init Columns
+                   cmdline_width = Columns = 80;   // need to init Columns
                    info_message = TRUE; // use mch_msg(), not mch_errmsg()
 # if defined(FEAT_GUI) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
                    gui.starting = FALSE; // not starting GUI, will exit
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 6693a76b4..94b8613a9 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -156,6 +156,26 @@ func Test_help_arg()
   call delete('Xtestout')
 endfunc
 
+func Test_version_arg()
+  " This does not work with a GUI-only binary, such as on MS-Windows.
+  CheckAnyOf Unix NotGui
+
+  if RunVim([], [], '--version >Xtestout')
+    let lines = readfile('Xtestout')
+    call assert_true(len(lines) > 10)
+    call assert_match('Vi IMproved', lines[0])
+
+    let idx = indexof(lines, 'v:val =~# "Features included.*:"')
+    call assert_true(idx >= 0)
+    call assert_true(idx + 1 < len(lines))
+    " Make sure the feature name is doubled on a line.
+    " For example, "+acl       +jumplist"
+    let feat_name = '[+-]+\?\w\+\%(()\)\?'
+    call assert_match($'^{feat_name}\s\+{feat_name}', lines[idx+1])
+  endif
+  call delete('Xtestout')
+endfunc
+
 func Test_compatible_args()
   let after =<< trim [CODE]
     call writefile([string(&compatible)], "Xtestout")
diff --git a/src/version.c b/src/version.c
index e18b2c8c3..def269c8f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2126,
 /**/
     2125,
 /**/

-- 
-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vmqxY-008rdf-BS%40256bit.org.

Raspunde prin e-mail lui