From ed1bfd04cd9c523e94e0c3f48263bf3e43de8a05 Mon Sep 17 00:00:00 2001 From: IChooseYou Date: Thu, 5 Mar 2026 05:46:14 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20tighten=20editor=20column=20spacing=20?= =?UTF-8?q?=E2=80=94=20skip=20struct/array=20in=20scope=20width=20calc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce kMinTypeW from 8 to 7, and exclude Struct/Array children from per-scope column width measurement so pointer headers don't inflate sibling hex row padding. --- src/compose.cpp | 6 ++++++ src/core.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compose.cpp b/src/compose.cpp index 6318e63..2d91894 100644 --- a/src/compose.cpp +++ b/src/compose.cpp @@ -1014,6 +1014,9 @@ ComposeResult compose(const NodeTree& tree, const Provider& prov, uint64_t viewR for (int childIdx : state.childMap.value(container.id)) { const Node& child = tree.nodes[childIdx]; + // Skip struct/array children — pointer headers shouldn't inflate sibling widths + if (child.kind == NodeKind::Struct || child.kind == NodeKind::Array) + continue; scopeMaxType = qMax(scopeMaxType, (int)nodeTypeName(child).size()); // Name width (skip hex, but include containers) @@ -1046,6 +1049,9 @@ ComposeResult compose(const NodeTree& tree, const Provider& prov, uint64_t viewR int rootMaxName = kMinNameW; for (int childIdx : state.childMap.value(0)) { const Node& child = tree.nodes[childIdx]; + // Skip struct/array children — pointer headers shouldn't inflate sibling widths + if (child.kind == NodeKind::Struct || child.kind == NodeKind::Array) + continue; rootMaxType = qMax(rootMaxType, (int)nodeTypeName(child).size()); // Name width (skip hex, include containers) diff --git a/src/core.h b/src/core.h index 5c3d106..c0bfdf7 100644 --- a/src/core.h +++ b/src/core.h @@ -699,7 +699,7 @@ inline constexpr int kColValue = 96; inline constexpr int kColComment = 28; // "// Enter=Save Esc=Cancel" fits inline constexpr int kColBaseAddr = 12; // "0x" + up to 10 hex digits (40-bit address) inline constexpr int kSepWidth = 1; -inline constexpr int kMinTypeW = 8; // Minimum type column width (fits "uint64_t") +inline constexpr int kMinTypeW = 7; // Minimum type column width (fits "uint8_t") inline constexpr int kMaxTypeW = 128; // Maximum type column width inline constexpr int kMinNameW = 8; // Minimum name column width (matches ASCII preview) inline constexpr int kMaxNameW = 128; // Maximum name column width