diff --git a/src/build/webgen/main_actions.zig b/src/build/webgen/main_actions.zig index f4dffbc139..1dc0865017 100644 --- a/src/build/webgen/main_actions.zig +++ b/src/build/webgen/main_actions.zig @@ -44,15 +44,24 @@ pub fn genKeybindActions(writer: anytype) !void { try writer.writeAll("`\n"); if (@hasDecl(help_strings.KeybindAction, field.name)) { + const doc = @field(help_strings.KeybindAction, field.name); + std.debug.print("Doc for {s}: {s}\n", .{ field.name, doc }); var iter = std.mem.splitScalar( u8, @field(help_strings.KeybindAction, field.name), '\n', ); while (iter.next()) |s| { + // If it is the last line and empty, then skip it. + if (iter.peek() == null and s.len == 0) continue; try buffer.appendSlice(s); try buffer.appendSlice("\n"); } } } + + // Write any remaining buffered documentation + if (buffer.items.len > 0) { + try writer.writeAll(buffer.items); + } } diff --git a/src/input/Binding.zig b/src/input/Binding.zig index 2fdbc4cbaa..b3d14fc220 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -236,9 +236,9 @@ pub const Action = union(enum) { /// Send an `ESC` sequence. esc: []const u8, - // Send the given text. Uses Zig string literal syntax. This is currently - // not validated. If the text is invalid (i.e. contains an invalid escape - // sequence), the error will currently only show up in logs. + /// Send the given text. Uses Zig string literal syntax. This is currently + /// not validated. If the text is invalid (i.e. contains an invalid escape + /// sequence), the error will currently only show up in logs. text: []const u8, /// Send data to the pty depending on whether cursor key mode is enabled