refactor(options): split get_option_value() into smaller functions

Problem: Currently, `get_option_value()` returns 3 separate things: The actual value of the option, whether the option is hidden, and the option flags. This makes the function difficult to refactor, modify or otherwise reason about.

Solution: Split `get_option_value()` into 3 functions, each with a single purpose. This also affects `get_option_value_for()`.
This commit is contained in:
Famiu Haque
2023-12-07 00:40:48 +06:00
committed by Lewis Russell
parent b2d471ab33
commit 9ae7d36ff5
6 changed files with 95 additions and 122 deletions

View File

@@ -3218,7 +3218,7 @@ void ex_spelldump(exarg_T *eap)
if (no_spell_checking(curwin)) {
return;
}
OptVal spl = get_option_value("spl", NULL, OPT_LOCAL, NULL);
OptVal spl = get_option_value(findoption("spl"), OPT_LOCAL);
// Create a new empty buffer in a new window.
do_cmdline_cmd("new");