From: Hirohito Higashi Date: Mon, 2 Feb 2026 10:08:10 +0000 (+0000) Subject: patch 9.1.2126: vim --version used single column for feature list X-Git-Tag: v9.1.2126^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65c5b8e7d0323eedfc47e86c41c361ef63510c32;p=thirdparty%2Fvim.git 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 Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/src/main.c b/src/main.c index 5ae94e43e0..c31b14d0c8 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 6693a76b4a..94b8613a9e 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 e18b2c8c3f..def269c8f0 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, /**/