refactor(options): option flags enum #30961

Problem: Currently we use macros with hardcoded flag values for option flags, which is messy and requires a lot of mental math for adding / removing option flags. Using macros for option flags also means that they cannot be used inside debuggers.

Solution: Create a new `OptFlags` enum that stores all the option flags in an organized way that is easier to understand.
This commit is contained in:
Famiu Haque
2024-10-28 19:49:16 +06:00
committed by GitHub
parent 0b7cc014fc
commit 34c44c3556
8 changed files with 144 additions and 150 deletions

View File

@@ -1249,7 +1249,7 @@ struct window_S {
// transform a pointer to a "onebuf" option into a "allbuf" option
#define GLOBAL_WO(p) ((char *)(p) + sizeof(winopt_T))
// A few options have local flags for P_INSECURE.
// A few options have local flags for kOptFlagInsecure.
uint32_t w_p_stl_flags; // flags for 'statusline'
uint32_t w_p_wbr_flags; // flags for 'winbar'
uint32_t w_p_fde_flags; // flags for 'foldexpr'