From 2490171304808803be9a88d48033b86cd3c8b93f Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Tue, 26 Aug 2025 18:45:15 -0500 Subject: [PATCH] surface: implement scroll-to-bottom=keystroke --- src/Surface.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index c17585aa1..d3267f7f4 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -272,6 +272,7 @@ const DerivedConfig = struct { title_report: bool, links: []Link, link_previews: configpkg.LinkPreviews, + scroll_to_bottom_on_keystroke: bool, const Link = struct { regex: oni.Regex, @@ -340,6 +341,7 @@ const DerivedConfig = struct { .title_report = config.@"title-report", .links = links, .link_previews = config.@"link-previews", + .scroll_to_bottom_on_keystroke = config.@"scroll-to-bottom".keystroke, // Assignments happen sequentially so we have to do this last // so that the memory is captured from allocs above. @@ -2280,7 +2282,8 @@ pub fn keyCallback( try self.setSelection(null); } - try self.io.terminal.scrollViewport(.{ .bottom = {} }); + if (self.config.scroll_to_bottom_on_keystroke) try self.io.terminal.scrollViewport(.bottom); + try self.queueRender(); }