]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0379: gui.color_approx is never used v9.2.0379
authorHirohito Higashi <h.east.727@gmail.com>
Mon, 20 Apr 2026 17:18:53 +0000 (17:18 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 20 Apr 2026 17:24:15 +0000 (17:24 +0000)
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) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/errors.h
src/ex_eval.c
src/gui.h
src/gui_x11.c
src/po/vim.pot
src/version.c

index 53e5b1dda62d782df5829bbdc1f8fdb9505592e1..8ac627af68d2c406e9f89dbeff539cc0bb2d985b 100644 (file)
@@ -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"));
index 00e4d5fcf3b3ae13d87a360e062894856b21012d..966c4f78a2bf9df5eefa0ca5d3f86b55d88ccc46 100644 (file)
@@ -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])
index 8b8b74020cc666f0c9beffc417f74a1e359e11d4..4639b3a1294e53aa9499e588919f6d9f633e587a 100644 (file)
--- 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
index 9cd8f5f72ea883b1210808ac7966486ee13765f4..dffa10cb64e3ab5d7e11d899db5f0b4bed30be1a 100644 (file)
@@ -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
index 936961c92ffa4bb4ba273906eb53a099c7872255..4cc00d1143d9a83765ab760cbbdeeb801bd5df4a 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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 ""
 
index d544375b0ff90af2f016d665548e35614c750cc2..d2d4b141ca3982f432f19728f2ec321978ef8b16 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    379,
 /**/
     378,
 /**/