mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 05:48:40 +00:00
deduplicate new file path maps on-add
This commit is contained in:
@@ -13552,11 +13552,27 @@ rd_frame(void)
|
|||||||
|
|
||||||
//- rjf: store as file path map cfg
|
//- rjf: store as file path map cfg
|
||||||
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
|
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
|
||||||
RD_Cfg *map = rd_cfg_new(user, str8_lit("file_path_map"));
|
{
|
||||||
RD_Cfg *src = rd_cfg_new(map, str8_lit("source"));
|
RD_CfgList cfgs = rd_cfg_child_list_from_string(scratch.arena, user, str8_lit("file_path_map"));
|
||||||
RD_Cfg *dst = rd_cfg_new(map, str8_lit("dest"));
|
RD_Cfg *map = &rd_nil_cfg;
|
||||||
rd_cfg_new(src, map_src);
|
for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next)
|
||||||
rd_cfg_new(dst, map_dst);
|
{
|
||||||
|
RD_Cfg *src = rd_cfg_child_from_string(n->v, str8_lit("source"));
|
||||||
|
if(path_match_normalized(src->first->string, map_src))
|
||||||
|
{
|
||||||
|
map = n->v;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(map == &rd_nil_cfg)
|
||||||
|
{
|
||||||
|
map = rd_cfg_new(user, str8_lit("file_path_map"));
|
||||||
|
}
|
||||||
|
RD_Cfg *src = rd_cfg_child_from_string_or_alloc(map, str8_lit("source"));
|
||||||
|
RD_Cfg *dst = rd_cfg_child_from_string_or_alloc(map, str8_lit("dest"));
|
||||||
|
rd_cfg_new_replace(src, map_src);
|
||||||
|
rd_cfg_new_replace(dst, map_dst);
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
//- rjf: panel removal
|
//- rjf: panel removal
|
||||||
|
|||||||
Reference in New Issue
Block a user