do not apply filters past one block layer (fixes broken expansions in debug info table tabs)

This commit is contained in:
Ryan Fleury
2025-05-06 09:24:34 -07:00
parent b8eace001a
commit e5a2f6da11
6 changed files with 61 additions and 28 deletions
+23 -1
View File
@@ -1154,7 +1154,29 @@ E_TYPE_ACCESS_FUNCTION_DEF(watches)
E_TYPE_EXPAND_INFO_FUNCTION_DEF(watches)
{
RD_WatchesAccel *accel = (RD_WatchesAccel *)eval.irtree.user_data;
RD_WatchesAccel *ext = (RD_WatchesAccel *)eval.irtree.user_data;
RD_WatchesAccel *accel = push_array(arena, RD_WatchesAccel, 1);
{
RD_CfgArray cfgs__filtered = ext->cfgs;
if(filter.size != 0)
{
Temp scratch = scratch_begin(&arena, 1);
RD_CfgList cfgs_list__filtered = {0};
for EachIndex(idx, ext->cfgs.count)
{
RD_Cfg *watch = ext->cfgs.v[idx];
String8 string = watch->first->string;
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, string);
if(matches.count == matches.needle_part_count)
{
rd_cfg_list_push(scratch.arena, &cfgs_list__filtered, watch);
}
}
cfgs__filtered = rd_cfg_array_from_list(arena, &cfgs_list__filtered);
scratch_end(scratch);
}
accel->cfgs = cfgs__filtered;
}
E_TypeExpandInfo result = {accel, accel->cfgs.count + 1};
return result;
}