macos: end_search for ending search
parent
c51170da9c
commit
5b4394d211
|
|
@ -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)")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue