loop: continue read_loop on null event

This commit is contained in:
Tim Culverhouse 2024-07-19 07:41:14 -05:00
parent b513fff3b4
commit 37941e59f5

View file

@ -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);
}
}