mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
refactor(options): remove getoption_T
and introduce OptVal
(#23850)
Removes the `getoption_T` struct and also introduces the `OptVal` struct to unify the methods of getting/setting different option value types. This is the first of many PRs to reduce code duplication in the Vim option code as well as to make options easier to maintain. It also increases the flexibility and extensibility of options. Which opens the door for things like Array and Dictionary options.
This commit is contained in:
@@ -2250,7 +2250,7 @@ void save_clear_shm_value(void)
|
||||
|
||||
if (++set_shm_recursive == 1) {
|
||||
STRCPY(shm_buf, p_shm);
|
||||
set_option_value_give_err("shm", 0L, "", 0);
|
||||
set_option_value_give_err("shm", STATIC_CSTR_AS_OPTVAL(""), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2258,7 +2258,7 @@ void save_clear_shm_value(void)
|
||||
void restore_shm_value(void)
|
||||
{
|
||||
if (--set_shm_recursive == 0) {
|
||||
set_option_value_give_err("shm", 0L, shm_buf, 0);
|
||||
set_option_value_give_err("shm", CSTR_AS_OPTVAL(shm_buf), 0);
|
||||
memset(shm_buf, 0, SHM_LEN);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user