aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/context.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2023-12-07 00:40:48 +0600
committerLewis Russell <me@lewisr.dev>2023-12-07 19:36:34 +0000
commit9ae7d36ff5ebaf75597b442e10890bd77df01fbe (patch)
tree7211492e2fea8e9b87336c3ea69f4c5b2c0b8702 /src/nvim/context.c
parentb2d471ab337e56f660eb7c89ae24f447f7b7a165 (diff)
downloadrneovim-9ae7d36ff5ebaf75597b442e10890bd77df01fbe.tar.gz
rneovim-9ae7d36ff5ebaf75597b442e10890bd77df01fbe.tar.bz2
rneovim-9ae7d36ff5ebaf75597b442e10890bd77df01fbe.zip
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()`.
Diffstat (limited to 'src/nvim/context.c')
-rw-r--r--src/nvim/context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/context.c b/src/nvim/context.c
index 28a67061c6..63c0f8c20c 100644
--- a/src/nvim/context.c
+++ b/src/nvim/context.c
@@ -138,7 +138,7 @@ bool ctx_restore(Context *ctx, const int flags)
free_ctx = true;
}
- OptVal op_shada = get_option_value("shada", NULL, OPT_GLOBAL, NULL);
+ OptVal op_shada = get_option_value(findoption("shada"), OPT_GLOBAL);
set_option_value("shada", STATIC_CSTR_AS_OPTVAL("!,'100,%"), OPT_GLOBAL);
if (flags & kCtxRegs) {