Merge pull request #1361 from gabydd/format-action

don't write ":" when printing keybinding action with no argument
This commit is contained in:
Mitchell Hashimoto
2024-01-22 18:04:58 -08:00
committed by GitHub

View File

@ -398,9 +398,11 @@ pub const Action = union(enum) {
// All actions start with the tag.
try writer.print("{s}", .{@tagName(self)});
// Write the value depending on the type
try writer.writeAll(":");
try formatValue(writer, value);
// Only write the value depending on the type if it's not void
if (@TypeOf(value) != void) {
try writer.writeAll(":");
try formatValue(writer, value);
}
},
}
}