add end_search binding

This commit is contained in:
Mitchell Hashimoto
2025-11-26 07:05:52 -08:00
parent f7b14a0142
commit c51170da9c
5 changed files with 31 additions and 20 deletions

View File

@@ -333,7 +333,11 @@ pub const Action = union(enum) {
set_font_size: f32,
/// Start a search for the given text. If the text is empty, then
/// the search is canceled. If a previous search is active, it is replaced.
/// the search is canceled. A canceled search will not disable any GUI
/// elements showing search. For that, the explicit end_search binding
/// should be used.
///
/// If a previous search is active, it is replaced.
search: []const u8,
/// Navigate the search results. If there is no active search, this
@@ -344,6 +348,9 @@ pub const Action = union(enum) {
/// search terms, but opens the UI for searching.
start_search,
/// End the current search if any and hide any GUI elements.
end_search,
/// Clear the screen and all scrollback.
clear_screen,
@@ -1172,6 +1179,7 @@ pub const Action = union(enum) {
.search,
.navigate_search,
.start_search,
.end_search,
.reset,
.copy_to_clipboard,
.copy_url_to_clipboard,

View File

@@ -169,6 +169,12 @@ fn actionCommands(action: Action.Key) []const Command {
.description = "Start a search if one isn't already active.",
}},
.end_search => comptime &.{.{
.action = .end_search,
.title = "End Search",
.description = "End the current search if any and hide any GUI elements.",
}},
.navigate_search => comptime &.{ .{
.action = .{ .navigate_search = .next },
.title = "Next Search Result",