[vim/vim] refactor(gui): remove dead color_approx flag and unreachable warning (PR #20007)

1 view
Skip to first unread message

h_east

unread,
Apr 18, 2026, 11:10:49 AM (2 days ago) Apr 18
to vim/vim, Subscribed

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.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20007

Commit Summary

  • a699df8 refactor(gui): remove dead color_approx flag and unreachable warning

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20007@github.com>

Christian Brabandt

unread,
1:19 PM (5 hours ago) 1:19 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20007)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20007/c4282859474@github.com>

Christian Brabandt

unread,
1:26 PM (5 hours ago) 1:26 PM
to vim/vim, Subscribed

Closed #20007 via fe3c27c.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20007/issue_event/24687696652@github.com>

Reply all
Reply to author
Forward
0 new messages