fix(ui): fix some cases of stale highlight definitions

fixes #20695
This commit is contained in:
bfredl
2022-11-12 16:41:36 +01:00
parent 7335a67b57
commit d7e7578ada
3 changed files with 81 additions and 31 deletions

View File

@@ -194,6 +194,25 @@ void decor_providers_invoke_end(DecorProviders *providers, char **err)
}
}
/// Mark all cached state of per-namespace highlights as invalid. Revalidate
/// current namespace.
///
/// Expensive! Should on be called by an already throttled validity check
/// like highlight_changed() (throttled to the next redraw or mode change)
void decor_provider_invalidate_hl(void)
{
size_t len = kv_size(decor_providers);
for (size_t i = 0; i < len; i++) {
DecorProvider *item = &kv_A(decor_providers, i);
item->hl_cached = false;
}
if (ns_hl_active) {
ns_hl_active = -1;
hl_check_ns();
}
}
DecorProvider *get_decor_provider(NS ns_id, bool force)
{
assert(ns_id > 0);