diff --git a/src/keybind/builtin/flow.json b/src/keybind/builtin/flow.json index a481efc..4e6b6db 100644 --- a/src/keybind/builtin/flow.json +++ b/src/keybind/builtin/flow.json @@ -40,8 +40,6 @@ ["ctrl+shift+f", "find_in_files"], ["ctrl+shift+l", "toggle_panel"], ["alt+shift+p", "open_command_palette"], - ["ctrl+shift+page_up", "terminal_scroll_up"], - ["ctrl+shift+page_down", "terminal_scroll_down"], ["alt+n", "goto_next_file_or_diagnostic"], ["alt+p", "goto_prev_file_or_diagnostic"], ["alt+l", "toggle_panel"], @@ -65,8 +63,8 @@ ["ctrl+shift+tab", "previous_tab"], ["ctrl+page_down", "next_tab"], ["ctrl+page_up", "previous_tab"], - ["ctrl+shift+page_down", "move_tab_next"], - ["ctrl+shift+page_up", "move_tab_previous"], + ["ctrl+shift+page_down", "move_tab_next_or_scroll_terminal_down"], + ["ctrl+shift+page_up", "move_tab_previous_or_scroll_terminal_up"], ["ctrl+k e", "switch_buffers"], ["alt+shift+v", "clipboard_history"], ["ctrl+0", "reset_fontsize"], @@ -600,6 +598,8 @@ ["ctrl+8", "focus_split", 7], ["ctrl+`", "focus_terminal"], ["ctrl+j", "toggle_panel"], + ["ctrl+shift+page_down", "terminal_scroll_down"], + ["ctrl+shift+page_up", "terminal_scroll_up"], ["ctrl+shift+j", "toggle_maximize_panel"], ["ctrl+shift+p", "open_command_palette"], ["alt+shift+p", "open_command_palette"], diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index 4fe76b6..76ad846 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -1591,6 +1591,22 @@ const cmds = struct { } pub const move_tab_previous_meta: Meta = .{ .description = "Move tab to previous position" }; + pub fn move_tab_next_or_scroll_terminal_down(self: *Self, _: Ctx) Result { + if (self.is_panel_view_showing(terminal_view)) + try command.executeName("terminal_scroll_down", .{}) + else + _ = try self.widgets_widget.msg(.{"move_tab_next"}); + } + pub const move_tab_next_or_scroll_terminal_down_meta: Meta = .{ .description = "Move tab next or scroll terminal down" }; + + pub fn move_tab_previous_or_scroll_terminal_up(self: *Self, _: Ctx) Result { + if (self.is_panel_view_showing(terminal_view)) + try command.executeName("terminal_scroll_up", .{}) + else + _ = try self.widgets_widget.msg(.{"move_tab_previous"}); + } + pub const move_tab_previous_or_scroll_terminal_up_meta: Meta = .{ .description = "Move tab previous or scroll terminal up" }; + pub fn place_next_tab(self: *Self, ctx: Ctx) Result { var pos: enum { before, after } = undefined; var buffer_ref: Buffer.Ref = undefined;