macos: end_search for ending search

pull/9709/head
Mitchell Hashimoto 2025-11-26 08:54:48 -08:00
parent c51170da9c
commit 5b4394d211
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
3 changed files with 11 additions and 4 deletions

View File

@ -93,7 +93,7 @@ extension Ghostty {
} else if oldValue != nil {
searchNeedleCancellable = nil
guard let surface = self.surface else { return }
let action = "search:"
let action = "end_search"
ghostty_surface_binding_action(surface, action, UInt(action.count))
}
}
@ -1512,7 +1512,7 @@ extension Ghostty {
@IBAction func findHide(_ sender: Any?) {
guard let surface = self.surface else { return }
let action = "search:"
let action = "end_search"
if (!ghostty_surface_binding_action(surface, action, UInt(action.count))) {
AppDelegate.logger.warning("action failed action=\(action)")
}

View File

@ -4944,16 +4944,23 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
},
.end_search => {
// We only return that this was performed if we actually
// stopped a search, but we also send the apprt end_search so
// that GUIs can clean up stale stuff.
const performed = self.search != null;
if (self.search) |*s| {
s.deinit();
self.search = null;
}
return try self.rt_app.performAction(
_ = try self.rt_app.performAction(
.{ .surface = self },
.end_search,
{},
);
return performed;
},
.search => |text| search: {

View File

@ -6419,7 +6419,7 @@ pub const Keybinds = struct {
try self.set.putFlags(
alloc,
.{ .key = .{ .physical = .escape } },
.{ .search = "" },
.end_search,
.{ .performable = true },
);
try self.set.putFlags(