Fix cursor jump on command row edit, data-change highlighting for containers, invalid pointer expansion, cycle detection with node IDs, O(n²) addNode cache, duplicate struct in C++ export, collapse bug for non-first root structs, remove hardcoded demo data

This commit is contained in:
megablocks(tm)
2026-02-07 12:02:41 -07:00
committed by sysadmin
parent 39cac316de
commit 9962e55820
7 changed files with 225 additions and 169 deletions

View File

@@ -255,6 +255,14 @@ static void emitStruct(GenContext& ctx, uint64_t structId) {
return;
}
// Deduplicate by struct type name (different nodes may share the same type)
QString typeName = ctx.structName(node);
if (ctx.emittedTypeNames.contains(typeName)) {
ctx.emittedIds.insert(structId);
ctx.visiting.remove(structId);
return;
}
// Emit nested struct types first (dependency order)
QVector<int> children = ctx.childMap.value(structId);
for (int ci : children) {
@@ -283,8 +291,7 @@ static void emitStruct(GenContext& ctx, uint64_t structId) {
}
ctx.emittedIds.insert(structId);
QString typeName = ctx.structName(node);
ctx.emittedTypeNames.insert(typeName);
int structSize = ctx.tree.structSpan(structId, &ctx.childMap);
ctx.output += QStringLiteral("#pragma pack(push, 1)\n");