From e7bfc17318effbe48c9bcdf471b2af805e7d8e33 Mon Sep 17 00:00:00 2001 From: Valentin Shinkarev Date: Sun, 1 Dec 2024 22:58:46 +0300 Subject: [PATCH] fix slow scroll in mouseReport --- src/Surface.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Surface.zig b/src/Surface.zig index eef2eb8b3..78a842673 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -2336,7 +2336,7 @@ pub fn scrollCallback( // If we're scrolling up or down, then send a mouse event. if (self.io.terminal.flags.mouse_event != .none) { - if (y.delta != 0) { + for (0..@abs(y.delta)) |_| { const pos = try self.rt_surface.getCursorPos(); try self.mouseReport(switch (y.direction()) { .up_right => .four, @@ -2344,7 +2344,7 @@ pub fn scrollCallback( }, .press, self.mouse.mods, pos); } - if (x.delta != 0) { + for (0..@abs(x.delta)) |_| { const pos = try self.rt_surface.getCursorPos(); try self.mouseReport(switch (x.direction()) { .up_right => .six,