Revert "refactor(options): set option value for non-current context directly" (#31924)

Reverts #31112
This commit is contained in:
zeertzjq
2025-01-09 12:32:25 +08:00
committed by GitHub
parent 822313e42b
commit 19c9572d36
14 changed files with 565 additions and 537 deletions

View File

@@ -81,12 +81,6 @@ typedef struct {
OptValData data;
} OptVal;
/// Context that an option is being set for.
typedef struct {
win_T *win;
buf_T *buf;
} OptCtx;
/// :set operator types
typedef enum {
OP_NONE = 0,
@@ -128,7 +122,8 @@ typedef struct {
/// length of the error buffer
size_t os_errbuflen;
OptCtx os_ctx;
void *os_win;
void *os_buf;
} optset_T;
/// Type for the callback function that is invoked after an option value is
@@ -197,12 +192,3 @@ typedef struct {
OptVal def_val; ///< default value
LastSet last_set; ///< script in which the option was last set
} vimoption_T;
/// Execute code with autocmd context
#define WITH_AUCMD_CONTEXT(ctx, code) \
do { \
aco_save_T _aco; \
aucmd_prepbuf_win(&_aco, ctx.buf, ctx.win); \
code; \
aucmd_restbuf(&_aco); \
} while (0)