mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-07 05:43:20 +00:00
surface: implement scroll-to-bottom=keystroke
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user