Add close tabs on the right action

This commit is contained in:
George Papadakis
2025-12-01 20:15:53 +02:00
committed by Mitchell Hashimoto
parent 894e8d91ba
commit 625d7274bf
12 changed files with 231 additions and 7 deletions

View File

@@ -600,9 +600,8 @@ pub const Action = union(enum) {
/// of the `confirm-close-surface` configuration setting.
close_surface,
/// Close the current tab and all splits therein _or_ close all tabs and
/// splits thein of tabs _other_ than the current tab, depending on the
/// mode.
/// Close the current tab and all splits therein, close all other tabs, or
/// close every tab to the right of the current one depending on the mode.
///
/// If the mode is not specified, defaults to closing the current tab.
///
@@ -1005,6 +1004,7 @@ pub const Action = union(enum) {
pub const CloseTabMode = enum {
this,
other,
right,
pub const default: CloseTabMode = .this;
};

View File

@@ -538,6 +538,11 @@ fn actionCommands(action: Action.Key) []const Command {
.title = "Close Other Tabs",
.description = "Close all tabs in this window except the current one.",
},
.{
.action = .{ .close_tab = .right },
.title = "Close Tabs on the Right",
.description = "Close every tab to the right of the current one.",
},
},
.close_window => comptime &.{.{