aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2024-11-08 11:57:59 +0600
committerFamiu Haque <famiuhaque@proton.me>2024-12-26 20:55:13 +0600
commit6257270040bc5c61a489f7fb9d4102223c36cf89 (patch)
treea0db9a3bf31b56dedd9a240b54c5d47b02ce43ff /src/nvim/ex_docmd.c
parent98763ce4e93752f22d379e3f735f4c78ae49afad (diff)
downloadrneovim-6257270040bc5c61a489f7fb9d4102223c36cf89.tar.gz
rneovim-6257270040bc5c61a489f7fb9d4102223c36cf89.tar.bz2
rneovim-6257270040bc5c61a489f7fb9d4102223c36cf89.zip
refactor(options): set option value for non-current context directly
Problem: Currently, we use `switch_option_context` to temporarily switch the current option context before setting an option for a different buffer / window. This is not ideal because we already support getting and setting option values for non-current contexts in the underlying implementation. Solution: Set option value for non-current context by passing the context directly to the lower level functions. Also introduce a new `OptCtx` struct to store option context information, this will scale much better if we add more option scopes and other context information in the future.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 551e8fcb1d..8ee9967465 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -5294,7 +5294,7 @@ static char *findfunc_find_file(char *findarg, size_t findarg_len, int count)
/// Returns NULL on success and an error message on failure.
const char *did_set_findfunc(optset_T *args)
{
- buf_T *buf = (buf_T *)args->os_buf;
+ buf_T *buf = args->os_ctx.buf;
int retval;
if (args->os_flags & OPT_LOCAL) {