Skip to content

Commit

Permalink
Merge pull request #2864 from s-valent/main
Browse files Browse the repository at this point in the history
Fix slow scroll in tui apps
  • Loading branch information
mitchellh authored Dec 1, 2024
2 parents 84e9aae + e7bfc17 commit 2cb334f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2336,15 +2336,15 @@ 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,
.down_left => .five,
}, .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,
Expand Down

0 comments on commit 2cb334f

Please sign in to comment.