Skip to content

refactor(gui): remove dead color_approx flag and unreachable warning#20007

Closed
h-east wants to merge 1 commit intovim:masterfrom
h-east:gui_T-remove-color_approx
Closed

refactor(gui): remove dead color_approx flag and unreachable warning#20007
h-east wants to merge 1 commit intovim:masterfrom
h-east:gui_T-remove-color_approx

Conversation

@h-east
Copy link
Copy Markdown
Member

@h-east h-east commented Apr 18, 2026

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 but a "// E458 unused" marker is left in place so the number is not reused by future changes. Update the example error code "E458" in the ex_eval.c comment to "E457" accordingly.

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 but a "// E458 unused" marker is left in place
so the number is not reused by future changes.  Update the example
error code "E458" in the ex_eval.c comment to "E457" accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chrisbra
Copy link
Copy Markdown
Member

thanks

@chrisbra chrisbra closed this in fe3c27c Apr 20, 2026
@h-east h-east deleted the gui_T-remove-color_approx branch April 20, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants