macos: make move_tab work

This commit is contained in:
Mitchell Hashimoto
2024-10-25 11:53:45 -07:00
parent 520dda65cb
commit de5ec5d83e
8 changed files with 117 additions and 5 deletions

View File

@@ -3916,7 +3916,7 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
.move_tab => |position| try self.rt_app.performAction(
.{ .surface = self },
.move_tab,
position,
.{ .amount = position },
),
.new_split => |direction| try self.rt_app.performAction(

View File

@@ -101,9 +101,11 @@ pub const Action = union(Key) {
toggle_visibility,
/// Moves a tab by a relative offset.
/// Adjusts the tab position based on `offset` (e.g., -1 for left, +1 for right).
/// If the new position is out of bounds, it wraps around cyclically within the tab range.
move_tab: isize,
///
/// Adjusts the tab position based on `offset` (e.g., -1 for left, +1
/// for right). If the new position is out of bounds, it wraps around
/// cyclically within the tab range.
move_tab: MoveTab,
/// Jump to a specific tab. Must handle the scenario that the tab
/// value is invalid.
@@ -314,6 +316,10 @@ pub const ResizeSplit = extern struct {
};
};
pub const MoveTab = extern struct {
amount: isize,
};
/// The tab to jump to. This is non-exhaustive so that integer values represent
/// the index (zero-based) of the tab to jump to. Negative values are special
/// values.