cleanup by just scrolling in the renderer

This commit is contained in:
Mitchell Hashimoto
2026-02-19 14:06:52 -08:00
parent 263469755c
commit eb335fb8dd
7 changed files with 33 additions and 39 deletions

View File

@@ -1070,12 +1070,6 @@ pub fn handleMessage(self: *Surface, msg: Message) !void {
.scrollbar => |scrollbar| self.updateScrollbar(scrollbar),
.scroll_to_bottom => {
self.queueIo(.{
.scroll_viewport = .{ .bottom = {} },
}, .unlocked);
},
.present_surface => try self.presentSurface(),
.password_input => |v| try self.passwordInput(v),
@@ -1180,7 +1174,7 @@ fn selectionScrollTick(self: *Surface) !void {
}
// Scroll the viewport as required
try t.scrollViewport(.{ .delta = delta });
t.scrollViewport(.{ .delta = delta });
// Next, trigger our drag behavior
const pin = t.screens.active.pages.pin(.{
@@ -2785,7 +2779,7 @@ pub fn keyCallback(
try self.setSelection(null);
}
if (self.config.scroll_to_bottom.keystroke) try self.io.terminal.scrollViewport(.bottom);
if (self.config.scroll_to_bottom.keystroke) self.io.terminal.scrollViewport(.bottom);
try self.queueRender();
}
@@ -3538,7 +3532,7 @@ pub fn scrollCallback(
// Modify our viewport, this requires a lock since it affects
// rendering. We have to switch signs here because our delta
// is negative down but our viewport is positive down.
try self.io.terminal.scrollViewport(.{ .delta = y.delta * -1 });
self.io.terminal.scrollViewport(.{ .delta = y.delta * -1 });
}
}
@@ -5069,7 +5063,7 @@ pub fn posToViewport(self: Surface, xpos: f64, ypos: f64) terminal.point.Coordin
///
/// Precondition: the render_state mutex must be held.
fn scrollToBottom(self: *Surface) !void {
try self.io.terminal.scrollViewport(.{ .bottom = {} });
self.io.terminal.scrollViewport(.{ .bottom = {} });
try self.queueRender();
}