feat(app): event line provides entire line contents as a single event; add(event): .cancel event
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m5s

Introduce `.cancel` event that is fired when the user sends EOF
in *non raw mode* renderings. The event `.line` now sends the
entire line (even if larger than the internal buffer) but requires
now an `Allocator`.
This commit is contained in:
2026-01-22 08:56:12 +01:00
parent 39fb8af174
commit 4441f1b933
20 changed files with 61 additions and 25 deletions
+9 -1
View File
@@ -8,6 +8,11 @@ pub const SystemEvent = union(enum) {
init,
/// Quit event to signify the end of the event loop (rendering should stop afterwards)
quit,
/// Cancel event to signify that the user provided an EOF
///
/// Usually this event is only triggered by the system in *non raw mode*
/// renderings otherwise the corresponding `.key` event would be fired instead.
cancel,
/// Resize event to signify that the application should re-draw to resize
///
/// Usually no `Container` nor `Element` should act on that event, as it
@@ -23,7 +28,10 @@ pub const SystemEvent = union(enum) {
/// associated error message
msg: []const u8,
},
/// Input line event received in non *raw mode* (instead of individual `key` events)
/// Input line event received in *non raw mode* (instead of individual `key` events)
///
/// This event contains the entire line until the ending newline character
/// (which is included in the payload of this event).
line: []const u8,
/// Input key event received from the user
key: Key,