mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
Ensure last action's documentation is properly generated
The issue was caused by the documentation generation logic not writing the final buffered content.
This commit is contained in:
@ -50,9 +50,16 @@ pub fn genKeybindActions(writer: anytype) !void {
|
|||||||
'\n',
|
'\n',
|
||||||
);
|
);
|
||||||
while (iter.next()) |s| {
|
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(s);
|
||||||
try buffer.appendSlice("\n");
|
try buffer.appendSlice("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write any remaining buffered documentation
|
||||||
|
if (buffer.items.len > 0) {
|
||||||
|
try writer.writeAll(buffer.items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,9 +236,9 @@ pub const Action = union(enum) {
|
|||||||
/// Send an `ESC` sequence.
|
/// Send an `ESC` sequence.
|
||||||
esc: []const u8,
|
esc: []const u8,
|
||||||
|
|
||||||
// Send the given text. Uses Zig string literal syntax. This is currently
|
/// 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
|
/// not validated. If the text is invalid (i.e. contains an invalid escape
|
||||||
// sequence), the error will currently only show up in logs.
|
/// sequence), the error will currently only show up in logs.
|
||||||
text: []const u8,
|
text: []const u8,
|
||||||
|
|
||||||
/// Send data to the pty depending on whether cursor key mode is enabled
|
/// Send data to the pty depending on whether cursor key mode is enabled
|
||||||
|
Reference in New Issue
Block a user