neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 0e299ebf75591b262d659704e84e3d5e7fc2aed9
parent 588ca99e123bbf28ba0bb4eeeeb126dc2213b64c
Author: JD <46619169+rudiejd@users.noreply.github.com>
Date:   Tue,  3 Dec 2024 06:41:37 -0500

fix(decorator): noisy errors from decoration provider #31418

Problem:
A broken decoration provider can cause endless errors. #27235

Solution:
Don't show decorator errors when they exceed `DP_MAX_ERROR`.
Diffstat:
Msrc/nvim/decoration_provider.c | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/nvim/decoration_provider.c b/src/nvim/decoration_provider.c @@ -55,14 +55,13 @@ static bool decor_provider_invoke(int provider_idx, const char *name, LuaRef ref // We get the provider here via an index in case the above call to nlua_call_ref causes // decor_providers to be reallocated. DecorProvider *provider = &kv_A(decor_providers, provider_idx); - if (!ERROR_SET(&err) && api_object_to_bool(ret, "provider %s retval", default_true, &err)) { provider->error_count = 0; return true; } - if (ERROR_SET(&err)) { + if (ERROR_SET(&err) && provider->error_count < DP_MAX_ERROR) { decor_provider_error(provider, name, err.msg); provider->error_count++;