diff options
author | Famiu Haque <famiuhaque@proton.me> | 2024-11-25 15:07:56 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 17:07:56 +0800 |
commit | beec377e905baca73e772080c4f276c800ad2a40 (patch) | |
tree | 478d0eafce4ac8a7153fa66f39bfc70ba5d2adbc /src/nvim/eval | |
parent | 9e7b0bcf51924716461f838a33a9508b718934b5 (diff) | |
download | rneovim-beec377e905baca73e772080c4f276c800ad2a40.tar.gz rneovim-beec377e905baca73e772080c4f276c800ad2a40.tar.bz2 rneovim-beec377e905baca73e772080c4f276c800ad2a40.zip |
refactor(options): fix confusing naming of `scope` and `req_scope` (#31317)
Problem: The name `scope` is often used to refer to option flags because
`OPT_LOCAL` and `OPT_GLOBAL` are often used to determine the option
scope. This leads to the name `req_scope` being used for actual option
scopes instead.
Solution: Since the end-goal is to remove `OPT_LOCAL` and `OPT_GLOBAL`
entirely and replace them with `OptScope`, rename `OptScope` variables
to `scope` and the old scope flag variables to `opt_flags`.
Diffstat (limited to 'src/nvim/eval')
-rw-r--r-- | src/nvim/eval/vars.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index 3ecb446cd6..8c8a8ac5e0 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -810,9 +810,9 @@ static char *ex_let_option(char *arg, typval_T *const tv, const bool is_const, // Find the end of the name. char *arg_end = NULL; OptIndex opt_idx; - int scope; + int opt_flags; - char *const p = (char *)find_option_var_end((const char **)&arg, &opt_idx, &scope); + char *const p = (char *)find_option_var_end((const char **)&arg, &opt_idx, &opt_flags); if (p == NULL || (endchars != NULL && vim_strchr(endchars, (uint8_t)(*skipwhite(p))) == NULL)) { emsg(_(e_letunexp)); @@ -824,7 +824,7 @@ static char *ex_let_option(char *arg, typval_T *const tv, const bool is_const, bool is_tty_opt = is_tty_option(arg); bool hidden = is_option_hidden(opt_idx); - OptVal curval = is_tty_opt ? get_tty_option(arg) : get_option_value(opt_idx, scope); + OptVal curval = is_tty_opt ? get_tty_option(arg) : get_option_value(opt_idx, opt_flags); OptVal newval = NIL_OPTVAL; if (curval.type == kOptValTypeNil) { @@ -881,7 +881,7 @@ static char *ex_let_option(char *arg, typval_T *const tv, const bool is_const, } } - const char *err = set_option_value_handle_tty(arg, opt_idx, newval, scope); + const char *err = set_option_value_handle_tty(arg, opt_idx, newval, opt_flags); arg_end = p; if (err != NULL) { emsg(_(err)); |