From d659b12fb9b9fb210270c204effad969c1b630b8 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 11 Dec 2023 23:35:40 +0300 Subject: [PATCH] input: add scroll_page_lines --- src/Surface.zig | 7 +++++++ src/input/Binding.zig | 1 + 2 files changed, 8 insertions(+) diff --git a/src/Surface.zig b/src/Surface.zig index b249df41b..e6c906310 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -2701,6 +2701,13 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool try self.io_thread.wakeup.notify(); }, + .scroll_page_lines => |lines| { + _ = self.io_thread.mailbox.push(.{ + .scroll_viewport = .{ .delta = lines }, + }, .{ .forever = {} }); + try self.io_thread.wakeup.notify(); + }, + .jump_to_prompt => |delta| { _ = self.io_thread.mailbox.push(.{ .jump_to_prompt = @intCast(delta), diff --git a/src/input/Binding.zig b/src/input/Binding.zig index 460e39dfc..19bdcdc27 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -167,6 +167,7 @@ pub const Action = union(enum) { scroll_page_up: void, scroll_page_down: void, scroll_page_fractional: f32, + scroll_page_lines: i16, /// Jump the viewport forward or back by prompt. Positive /// number is the number of prompts to jump forward, negative