mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
updated logic for grouping actions
This commit is contained in:
@ -22,9 +22,18 @@ pub fn genKeybindActions(writer: anytype) !void {
|
|||||||
|
|
||||||
@setEvalBranchQuota(5_000);
|
@setEvalBranchQuota(5_000);
|
||||||
const fields = @typeInfo(KeybindAction).Union.fields;
|
const fields = @typeInfo(KeybindAction).Union.fields;
|
||||||
|
|
||||||
|
var buffer = std.ArrayList(u8).init(std.heap.page_allocator);
|
||||||
inline for (fields) |field| {
|
inline for (fields) |field| {
|
||||||
if (field.name[0] == '_') continue;
|
if (field.name[0] == '_') continue;
|
||||||
|
|
||||||
|
if (@hasDecl(help_strings.KeybindAction, field.name)) {
|
||||||
|
try writer.writeAll(buffer.items);
|
||||||
|
try writer.writeAll("\n");
|
||||||
|
|
||||||
|
buffer.clearRetainingCapacity();
|
||||||
|
}
|
||||||
|
|
||||||
// Write the field name.
|
// Write the field name.
|
||||||
try writer.writeAll("## `");
|
try writer.writeAll("## `");
|
||||||
try writer.writeAll(field.name);
|
try writer.writeAll(field.name);
|
||||||
@ -37,10 +46,9 @@ pub fn genKeybindActions(writer: anytype) !void {
|
|||||||
'\n',
|
'\n',
|
||||||
);
|
);
|
||||||
while (iter.next()) |s| {
|
while (iter.next()) |s| {
|
||||||
try writer.writeAll(s);
|
try buffer.appendSlice(s);
|
||||||
try writer.writeAll("\n");
|
try buffer.appendSlice("\n");
|
||||||
}
|
}
|
||||||
try writer.writeAll("\n\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user