Add "Scroll to Selection" command

This commit is contained in:
fn ⌃ ⌥
2025-05-03 09:07:12 -07:00
committed by Mitchell Hashimoto
parent eb7368699b
commit 071531c5c5
3 changed files with 16 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ pub const Action = union(enum) {
/// Scroll the screen varying amounts.
scroll_to_top,
scroll_to_bottom,
scroll_to_selection,
scroll_page_up,
scroll_page_down,
scroll_page_fractional: f32,
@@ -789,6 +790,7 @@ pub const Action = union(enum) {
.select_all,
.scroll_to_top,
.scroll_to_bottom,
.scroll_to_selection,
.scroll_page_up,
.scroll_page_down,
.scroll_page_fractional,

View File

@@ -170,6 +170,12 @@ fn actionCommands(action: Action.Key) []const Command {
.description = "Scroll to the bottom of the screen.",
}},
.scroll_to_selection => comptime &.{.{
.action = .scroll_to_selection,
.title = "Scroll to Selection",
.description = "Scroll to the selected text.",
}},
.scroll_page_up => comptime &.{.{
.action = .scroll_page_up,
.title = "Scroll Page Up",