diff options
author | luukvbaal <luukvbaal@gmail.com> | 2024-12-17 13:12:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 04:12:22 -0800 |
commit | 6bf2a6fc5bb395b67c88cb26d332f882a106c7ab (patch) | |
tree | 44259c3b4df40c5af3a4bacec308945f93365d6e /src/nvim/option.c | |
parent | b03e790cddd19b57fa91f4fbfcc30c28f3c173bf (diff) | |
download | rneovim-6bf2a6fc5bb395b67c88cb26d332f882a106c7ab.tar.gz rneovim-6bf2a6fc5bb395b67c88cb26d332f882a106c7ab.tar.bz2 rneovim-6bf2a6fc5bb395b67c88cb26d332f882a106c7ab.zip |
refactor(api): always use TRY_WRAP #31600
Problem: Two separate try/end wrappers, that only marginally differ by
restoring a few variables. Wrappers that don't restore
previous state are dangerous to use in "api-fast" functions.
Solution: Remove wrappers that don't restore the previous state.
Always use TRY_WRAP.
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index e261f06b42..9ad8256f16 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3933,7 +3933,7 @@ static bool switch_option_context(void *const ctx, OptScope scope, void *const f == FAIL) { restore_win_noblock(switchwin, true); - if (try_end(err)) { + if (ERROR_SET(err)) { return false; } api_set_error(err, kErrorTypeException, "Problem while switching windows"); |