patch 9.2.0379: gui.color_approx is never used
Commit:
https://github.com/vim/vim/commit/fe3c27ce0b7b889a2ae29833cae55ca92ae86518
Author: Hirohito Higashi <
h.eas...@gmail.com>
Date: Mon Apr 20 17:18:53 2026 +0000
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) <
nor...@anthropic.com>
Signed-off-by: Hirohito Higashi <
h.eas...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/errors.h b/src/errors.h
index 53e5b1dda..8ac627af6 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 00e4d5fcf..966c4f78a 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 8b8b74020..4639b3a12 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 9cd8f5f72..dffa10cb6 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 936961c92..4cc00d114 100644
--- a/src/po/vim.pot
+++ b/src/po/vim.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim
"
"Report-Msgid-Bugs-To:
vim...@vim.org
"
-"POT-Creation-Date: 2026-04-15 19:10+0000
"
+"POT-Creation-Date: 2026-04-20 17:22+0000
"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>
"
"Language-Team: LANGUAGE <
L...@li.org>
"
@@ -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 d544375b0..d2d4b141c 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,
/**/