mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
input: converting set entries to Entry from Action
This commit is contained in:
committed by
Mitchell Hashimoto
parent
bc4eab4af7
commit
7dfad49e40
@@ -117,13 +117,17 @@ fn prettyPrint(alloc: Allocator, keybinds: Config.Keybinds) !u8 {
|
||||
var widest_key: usize = 0;
|
||||
var buf: [64]u8 = undefined;
|
||||
while (iter.next()) |bind| {
|
||||
const action = switch (bind.value_ptr.*) {
|
||||
.leader => continue, // TODO: support this
|
||||
.action, .action_unconsumed => |action| action,
|
||||
};
|
||||
const key = switch (bind.key_ptr.key) {
|
||||
.translated => |k| try std.fmt.bufPrint(&buf, "{s}", .{@tagName(k)}),
|
||||
.physical => |k| try std.fmt.bufPrint(&buf, "physical:{s}", .{@tagName(k)}),
|
||||
.unicode => |c| try std.fmt.bufPrint(&buf, "{u}", .{c}),
|
||||
};
|
||||
widest_key = @max(widest_key, win.gwidth(key));
|
||||
try bindings.append(.{ .trigger = bind.key_ptr.*, .action = bind.value_ptr.* });
|
||||
try bindings.append(.{ .trigger = bind.key_ptr.*, .action = action });
|
||||
}
|
||||
std.mem.sort(Binding, bindings.items, {}, Binding.lessThan);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user