surface: store entire scroll-to-bottom struct

pull/8412/head
Jeffrey C. Ollie 2025-08-26 22:04:23 -05:00
parent 2490171304
commit 87056a2600
No known key found for this signature in database
GPG Key ID: 6F86035A6D97044E
1 changed files with 3 additions and 3 deletions

View File

@ -272,7 +272,7 @@ const DerivedConfig = struct {
title_report: bool, title_report: bool,
links: []Link, links: []Link,
link_previews: configpkg.LinkPreviews, link_previews: configpkg.LinkPreviews,
scroll_to_bottom_on_keystroke: bool, scroll_to_bottom: configpkg.Config.ScrollToBottom,
const Link = struct { const Link = struct {
regex: oni.Regex, regex: oni.Regex,
@ -341,7 +341,7 @@ const DerivedConfig = struct {
.title_report = config.@"title-report", .title_report = config.@"title-report",
.links = links, .links = links,
.link_previews = config.@"link-previews", .link_previews = config.@"link-previews",
.scroll_to_bottom_on_keystroke = config.@"scroll-to-bottom".keystroke, .scroll_to_bottom = config.@"scroll-to-bottom",
// Assignments happen sequentially so we have to do this last // Assignments happen sequentially so we have to do this last
// so that the memory is captured from allocs above. // so that the memory is captured from allocs above.
@ -2282,7 +2282,7 @@ pub fn keyCallback(
try self.setSelection(null); try self.setSelection(null);
} }
if (self.config.scroll_to_bottom_on_keystroke) try self.io.terminal.scrollViewport(.bottom); if (self.config.scroll_to_bottom.keystroke) try self.io.terminal.scrollViewport(.bottom);
try self.queueRender(); try self.queueRender();
} }