From 1dc0fcf9b5a915d221e67333300d391264bdbc21 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 14 Jan 2026 11:11:19 +0100 Subject: [PATCH] feat: scroll editor horizontally when in alt scroll mode --- src/tui/editor.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 72ed088..37b6a18 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2794,16 +2794,20 @@ pub const Editor = struct { self.update_scroll_dest_abs(dest.row); } - pub fn scroll_up_pageup(self: *Self, _: Context) Result { - if (self.fast_scroll) + pub fn scroll_up_pageup(self: *Self, ctx: Context) Result { + if (self.alt_scroll) + try self.move_scroll_left(ctx) + else if (self.fast_scroll) self.scroll_pageup() else self.scroll_up(); } pub const scroll_up_pageup_meta: Meta = .{}; - pub fn scroll_down_pagedown(self: *Self, _: Context) Result { - if (self.fast_scroll) + pub fn scroll_down_pagedown(self: *Self, ctx: Context) Result { + if (self.alt_scroll) + try self.move_scroll_right(ctx) + else if (self.fast_scroll) self.scroll_pagedown() else self.scroll_down();