[vim/vim] refactor: change boolean win_T members from int/char to bool (PR #20008)

4 views
Skip to first unread message

h_east

unread,
Apr 18, 2026, 12:14:18 PM (2 days ago) Apr 18
to vim/vim, Subscribed

Problem:
Several win_T fields are declared as "int" or "char" but are used strictly as boolean flags with TRUE/FALSE values. The integer types obscure the boolean intent and are wider than needed.

Solution:
Change the following win_T members to bool (stdbool.h) and update their assignments from TRUE/FALSE to true/false accordingly.

  • int -> bool (10 members): w_set_curswant, w_botfill, w_old_botfill, w_do_win_fix_cursor, w_popup_fixed, w_border_highlight_isset, w_cline_folded, w_redr_status, w_arg_idx_invalid, w_has_scrollbar

  • char -> bool (4 members): w_topline_was_set, w_ru_empty, w_fold_manual, w_foldinvalid

No existing code compares these members against TRUE/FALSE explicitly or uses ++/-- / bitwise ops on them, so only plain assignments are affected.

Excluded: w_locked (recursion counter with ++/--), w_want_scrollbar (may hold -1 from dict_get_bool), w_winbar_height (used in arithmetic and exposed as number via getwininfo()).


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

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

Commit Summary

  • 6f9a2e0 refactor: change boolean win_T members from int/char to bool

File Changes

(36 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/20008@github.com>

Christian Brabandt

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

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/20008/c4282816599@github.com>

Christian Brabandt

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

Closed #20008 via 146d5da.


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/20008/issue_event/24687465499@github.com>

Reply all
Reply to author
Forward
0 new messages