]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2126: vim --version used single column for feature list v9.1.2126
authorHirohito Higashi <h.east.727@gmail.com>
Mon, 2 Feb 2026 10:08:10 +0000 (10:08 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 2 Feb 2026 10:08:10 +0000 (10:08 +0000)
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 <ben.knoble+github@gmail.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/main.c
src/testdir/test_startup.vim
src/version.c

index 5ae94e43e0d35b851761edc273fb491107b60ca7..c31b14d0c8670770ca6d20d7bf66fa2a9e29ba97 100644 (file)
@@ -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
index 6693a76b4a26abd7b715367f33323824e10f89ea..94b8613a9e0caf5c91818027208e1c6e59e13144 100644 (file)
@@ -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")
index e18b2c8c3f9825d36ed53a04fbafb7b9dc732686..def269c8f0d845f85227069179fcaafb2a100f4f 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2126,
 /**/
     2125,
 /**/