Merge remote-tracking branch 'upstream/main' into jacob/uucode

This commit is contained in:
Jacob Sandlund
2025-09-01 01:34:03 -04:00
74 changed files with 3060 additions and 1182 deletions

View File

@@ -552,11 +552,15 @@ pub const Action = union(enum) {
/// of the `confirm-close-surface` configuration setting.
close_surface,
/// Close the current tab and all splits therein.
/// 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.
///
/// If the mode is not specified, defaults to closing the current tab.
///
/// This might trigger a close confirmation popup, depending on the value
/// of the `confirm-close-surface` configuration setting.
close_tab,
close_tab: CloseTabMode,
/// Close the current window and all tabs and splits therein.
///
@@ -858,6 +862,13 @@ pub const Action = union(enum) {
hide,
};
pub const CloseTabMode = enum {
this,
other,
pub const default: CloseTabMode = .this;
};
fn parseEnum(comptime T: type, value: []const u8) !T {
return std.meta.stringToEnum(T, value) orelse return Error.InvalidFormat;
}

View File

@@ -393,11 +393,18 @@ fn actionCommands(action: Action.Key) []const Command {
.description = "Close the current terminal.",
}},
.close_tab => comptime &.{.{
.action = .close_tab,
.title = "Close Tab",
.description = "Close the current tab.",
}},
.close_tab => comptime &.{
.{
.action = .{ .close_tab = .this },
.title = "Close Tab",
.description = "Close the current tab.",
},
.{
.action = .{ .close_tab = .other },
.title = "Close Other Tabs",
.description = "Close all tabs in this window except the current one.",
},
},
.close_window => comptime &.{.{
.action = .close_window,