Window switching initial

This commit is contained in:
Max Bretschneider
2025-10-21 22:13:42 +02:00
committed by Mitchell Hashimoto
parent 1805a9cb87
commit 1c1ef99fb1
6 changed files with 88 additions and 0 deletions

View File

@@ -545,6 +545,10 @@ pub const Action = union(enum) {
/// (`previous` and `next`).
goto_split: SplitFocusDirection,
/// Focus on either the previous window or the next one ('previous', 'next')
goto_window: WindowDirection,
/// Zoom in or out of the current split.
///
/// When a split is zoomed into, it will take up the entire space in
@@ -931,6 +935,11 @@ pub const Action = union(enum) {
right,
};
pub const WindowDirection = enum {
previous,
next,
};
pub const SplitResizeParameter = struct {
SplitResizeDirection,
u16,
@@ -1250,6 +1259,7 @@ pub const Action = union(enum) {
.toggle_tab_overview,
.new_split,
.goto_split,
.goto_window,
.toggle_split_zoom,
.toggle_readonly,
.resize_split,

View File

@@ -479,6 +479,20 @@ fn actionCommands(action: Action.Key) []const Command {
},
},
.goto_window => comptime &.{
.{
.action = .{ .goto_window = .previous },
.title = "Focus Window: Previous",
.description = "Focus the previous window, if any.",
},
.{
.action = .{ .goto_window = .previous },
.title = "Focus Window: Next",
.description = "Focus the next window, if any.",
},
},
.toggle_split_zoom => comptime &.{.{
.action = .toggle_split_zoom,
.title = "Toggle Split Zoom",