feat: add enable/disable_alt_scroll commands

This commit is contained in:
CJ van den Berg 2026-01-14 11:10:46 +01:00
parent 385478741f
commit 6828b24367
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -373,6 +373,7 @@ pub const Editor = struct {
handlers: EventHandler.List, handlers: EventHandler.List,
scroll_dest: usize = 0, scroll_dest: usize = 0,
fast_scroll: bool = false, fast_scroll: bool = false,
alt_scroll: bool = false,
jump_mode: bool = false, jump_mode: bool = false,
animation_step: usize = 0, animation_step: usize = 0,
@ -5098,6 +5099,16 @@ pub const Editor = struct {
} }
pub const disable_fast_scroll_meta: Meta = .{}; pub const disable_fast_scroll_meta: Meta = .{};
pub fn enable_alt_scroll(self: *Self, _: Context) Result {
self.alt_scroll = true;
}
pub const enable_alt_scroll_meta: Meta = .{ .description = "Enable horizontal scroll mode" };
pub fn disable_alt_scroll(self: *Self, _: Context) Result {
self.alt_scroll = false;
}
pub const disable_alt_scroll_meta: Meta = .{};
pub fn enable_jump_mode(self: *Self, _: Context) Result { pub fn enable_jump_mode(self: *Self, _: Context) Result {
self.jump_mode = true; self.jump_mode = true;
tui.rdr().request_mouse_cursor_pointer(true); tui.rdr().request_mouse_cursor_pointer(true);