Merge pull request #2124 from rockorager/format-keysequences
cli(list-keybinds): format key sequencespull/2129/head
commit
c9f40b7b8d
|
|
@ -3430,7 +3430,7 @@ pub const Keybinds = struct {
|
|||
[]const u8,
|
||||
std.fmt.bufPrint(
|
||||
&buf,
|
||||
"{}={}",
|
||||
"{}{}",
|
||||
.{ k, v },
|
||||
) catch return error.OutOfMemory,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -800,11 +800,20 @@ pub const Set = struct {
|
|||
_ = opts;
|
||||
|
||||
switch (self) {
|
||||
.leader => @panic("TODO"),
|
||||
.leader => |set| {
|
||||
// the leader key was already printed.
|
||||
var iter = set.bindings.iterator();
|
||||
while (iter.next()) |binding| {
|
||||
try writer.print(
|
||||
">{s}{s}",
|
||||
.{ binding.key_ptr.*, binding.value_ptr.* },
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
.action, .action_unconsumed => |action| {
|
||||
// action implements the format
|
||||
try writer.print("{s}", .{action});
|
||||
try writer.print("={s}", .{action});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue