diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-26 09:47:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-26 01:47:29 +0000 |
commit | a2b464944a4eb391fe6213304a4df5677845b52c (patch) | |
tree | eea69ac7d7c9c939b2a3f6f94509f60bbc5b3aec | |
parent | 93278e7720b23dd4762b414f1aa6c2a292a9ce07 (diff) | |
download | rneovim-a2b464944a4eb391fe6213304a4df5677845b52c.tar.gz rneovim-a2b464944a4eb391fe6213304a4df5677845b52c.tar.bz2 rneovim-a2b464944a4eb391fe6213304a4df5677845b52c.zip |
refactor(options): fix coverity warning about unintialized sc_chan (#32630)
-rw-r--r-- | src/nvim/option.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index e5efdb9924..4506c21668 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3485,15 +3485,7 @@ static const char *did_set_option(OptIndex opt_idx, void *varp, OptVal old_value new_value = optval_from_varp(opt_idx, varp); if (set_sid != SID_NONE) { - sctx_T script_ctx; - - if (set_sid == 0) { - script_ctx = current_sctx; - } else { - script_ctx.sc_sid = set_sid; - script_ctx.sc_seq = 0; - script_ctx.sc_lnum = 0; - } + sctx_T script_ctx = set_sid == 0 ? current_sctx : (sctx_T){ .sc_sid = set_sid }; // Remember where the option was set. set_option_sctx(opt_idx, opt_flags, script_ctx); } |