From: Hirohito Higashi Date: Mon, 20 Apr 2026 17:18:53 +0000 (+0000) Subject: patch 9.2.0379: gui.color_approx is never used X-Git-Tag: v9.2.0379^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe3c27ce0b7b889a2ae29833cae55ca92ae86518;p=thirdparty%2Fvim.git patch 9.2.0379: gui.color_approx is never used Problem: gui.color_approx in gui_T has not been assigned anywhere since patch 7.4.2094 ("The color allocation in X11 is overly complicated", 2016), which dropped the single "gui.color_approx = TRUE;" site. Because the member is zero-initialized and never written, the check "if (gui.color_approx)" in gui_mch_init() is always false and the "E458: Cannot allocate colormap entry, ..." warning can never be emitted. Solution: Remove the struct member and the unreachable branch. The E458 error definition is removed. Update the example error code "E458" in the ex_eval.c comment to "E457" accordingly. closes: #20007 Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/src/errors.h b/src/errors.h index 53e5b1dda6..8ac627af68 100644 --- a/src/errors.h +++ b/src/errors.h @@ -1138,10 +1138,7 @@ EXTERN char e_cant_find_postscript_resource_file_str_ps[] EXTERN char e_cant_read_postscript_resource_file_str[] INIT(= N_("E457: Can't read PostScript resource file \"%s\"")); #endif -#ifdef FEAT_GUI_X11 -EXTERN char e_cannot_allocate_colormap_entry_some_colors_may_be_incorrect[] - INIT(= N_("E458: Cannot allocate colormap entry, some colors may be incorrect")); -#endif +// E458 unused #if defined(UNIX) || defined(FEAT_SESSION) EXTERN char e_cannot_go_back_to_previous_directory[] INIT(= N_("E459: Cannot go back to previous directory")); diff --git a/src/ex_eval.c b/src/ex_eval.c index 00e4d5fcf3..966c4f78a2 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -275,7 +275,7 @@ cause_errthrow( { char *tmsg; - // Skip the extra "Vim " prefix for message "E458". + // Skip the extra "Vim " prefix for message "E457". tmsg = elem->msg; if (STRNCMP(tmsg, "Vim E", 5) == 0 && VIM_ISDIGIT(tmsg[5]) diff --git a/src/gui.h b/src/gui.h index 8b8b74020c..4639b3a129 100644 --- a/src/gui.h +++ b/src/gui.h @@ -341,7 +341,6 @@ typedef struct Gui Bool rsrc_rev_video; // Use reverse video? char_u *geom; // Geometry, eg "80x24" - Bool color_approx; // Some color was approximated #endif #ifdef FEAT_GUI_GTK diff --git a/src/gui_x11.c b/src/gui_x11.c index 9cd8f5f72e..dffa10cb64 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -1419,9 +1419,6 @@ gui_mch_init(void) #endif } - if (gui.color_approx) - emsg(_(e_cannot_allocate_colormap_entry_some_colors_may_be_incorrect)); - #ifdef FEAT_BEVAL_GUI gui_init_tooltip_font(); #endif diff --git a/src/po/vim.pot b/src/po/vim.pot index 936961c92f..4cc00d1143 100644 --- a/src/po/vim.pot +++ b/src/po/vim.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Vim\n" "Report-Msgid-Bugs-To: vim-dev@vim.org\n" -"POT-Creation-Date: 2026-04-15 19:10+0000\n" +"POT-Creation-Date: 2026-04-20 17:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -5222,9 +5222,6 @@ msgstr "" msgid "E457: Can't read PostScript resource file \"%s\"" msgstr "" -msgid "E458: Cannot allocate colormap entry, some colors may be incorrect" -msgstr "" - msgid "E459: Cannot go back to previous directory" msgstr "" diff --git a/src/version.c b/src/version.c index d544375b0f..d2d4b141ca 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 */ +/**/ + 379, /**/ 378, /**/