diff options
author | Famiu Haque <famiuhaque@proton.me> | 2024-10-28 19:49:16 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-28 06:49:16 -0700 |
commit | 34c44c355646311aa67fe53e1e5ce040789430c6 (patch) | |
tree | 6de3c32213b1313d41035c17b024fcade9afc6ef /src/nvim/eval/vars.c | |
parent | 0b7cc014fc0ed8d0765e8504ff4a8ff7a84dac42 (diff) | |
download | rneovim-34c44c355646311aa67fe53e1e5ce040789430c6.tar.gz rneovim-34c44c355646311aa67fe53e1e5ce040789430c6.tar.bz2 rneovim-34c44c355646311aa67fe53e1e5ce040789430c6.zip |
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.
Diffstat (limited to 'src/nvim/eval/vars.c')
-rw-r--r-- | src/nvim/eval/vars.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index d002bff321..d3f836f7f4 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -1908,7 +1908,7 @@ static OptVal tv_to_optval(typval_T *tv, OptIndex opt_idx, const char *option, b const bool option_has_num = !is_tty_opt && option_has_type(opt_idx, kOptValTypeNumber); const bool option_has_str = is_tty_opt || option_has_type(opt_idx, kOptValTypeString); - if (!is_tty_opt && (get_option(opt_idx)->flags & P_FUNC) && tv_is_func(*tv)) { + if (!is_tty_opt && (get_option(opt_idx)->flags & kOptFlagFunc) && tv_is_func(*tv)) { // If the option can be set to a function reference or a lambda // and the passed value is a function reference, then convert it to // the name (string) of the function reference. |