mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 12:15:00 -07:00
cfg query eval filtering
This commit is contained in:
@@ -15209,7 +15209,10 @@ rd_frame(void)
|
||||
case RD_CmdKind_AddColor:
|
||||
{
|
||||
RD_Cfg *parent = rd_cfg_from_id(rd_regs()->cfg);
|
||||
rd_cfg_new(parent, str8_lit("color"));
|
||||
RD_Cfg *color = rd_cfg_new(parent, str8_lit("color"));
|
||||
rd_cfg_new(color, str8_lit("tags"));
|
||||
RD_Cfg *value = rd_cfg_new(color, str8_lit("value"));
|
||||
rd_cfg_new(value, str8_lit("0xffffffff"));
|
||||
}break;
|
||||
case RD_CmdKind_ImportColors:
|
||||
{
|
||||
|
||||
@@ -740,9 +740,24 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(cfgs_query)
|
||||
}
|
||||
}
|
||||
RD_CfgList children = rd_cfg_child_list_from_string(scratch.arena, root_cfg, child_key);
|
||||
RD_CfgList children__filtered = children;
|
||||
if(filter.size != 0)
|
||||
{
|
||||
MemoryZeroStruct(&children__filtered);
|
||||
for(RD_CfgNode *n = children.first; n != 0; n = n->next)
|
||||
{
|
||||
DR_FStrList cfg_fstrs = rd_title_fstrs_from_cfg(scratch.arena, n->v);
|
||||
String8 cfg_string = dr_string_from_fstrs(scratch.arena, &cfg_fstrs);
|
||||
FuzzyMatchRangeList ranges = fuzzy_match_find(scratch.arena, filter, cfg_string);
|
||||
if(ranges.count == ranges.needle_part_count)
|
||||
{
|
||||
rd_cfg_list_push(scratch.arena, &children__filtered, n->v);
|
||||
}
|
||||
}
|
||||
}
|
||||
accel->cmds = str8_array_from_list(arena, &cmds);
|
||||
accel->cmds_idx_range = r1u64(0, accel->cmds.count);
|
||||
accel->cfgs = rd_cfg_array_from_list(arena, &children);
|
||||
accel->cfgs = rd_cfg_array_from_list(arena, &children__filtered);
|
||||
accel->cfgs_idx_range = r1u64(accel->cmds.count + 0, accel->cmds.count + accel->cfgs.count);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
@@ -3565,7 +3565,7 @@ rd_eval_color_from_eval(E_Eval eval)
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color)
|
||||
{
|
||||
EV_ExpandInfo info = {0};
|
||||
info.row_count = 8;
|
||||
info.row_count = 12;
|
||||
info.single_item = 1;
|
||||
return info;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user