From 37941e59f5aa97b20987f7219ca9e32a65792755 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 19 Jul 2024 07:41:14 -0500 Subject: [PATCH] loop: continue read_loop on null event --- src/Loop.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Loop.zig b/src/Loop.zig index 59f589e..006db26 100644 --- a/src/Loop.zig +++ b/src/Loop.zig @@ -136,7 +136,7 @@ pub fn Loop(comptime T: type) type { var buf: [1024]u8 = undefined; var read_start: usize = 0; // read loop - while (!self.should_quit) { + read_loop: while (!self.should_quit) { const n = try self.tty.read(buf[read_start..]); var seq_start: usize = 0; while (seq_start < n) { @@ -154,7 +154,7 @@ pub fn Loop(comptime T: type) type { read_start = 0; seq_start += result.n; - const event = result.event orelse continue; + const event = result.event orelse continue :read_loop; try handleEventGeneric(self, self.vaxis, &cache, Event, event, paste_allocator); } }