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
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:
+9
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user