mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-22 15:25:20 +00:00
macOS: Selection for Find feature
Adds the `selection_for_search` action, with Cmd+E keybind by default. This action inputs the currently selected text into the search field without changing focus, matching standard macOS behavior.
This commit is contained in:
@@ -5163,6 +5163,15 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
||||
);
|
||||
},
|
||||
|
||||
.selection_for_search => {
|
||||
const selection = try self.selectionString(self.alloc) orelse return false;
|
||||
return try self.rt_app.performAction(
|
||||
.{ .surface = self },
|
||||
.selection_for_search,
|
||||
.{ .text = selection },
|
||||
);
|
||||
},
|
||||
|
||||
.end_search => {
|
||||
// We only return that this was performed if we actually
|
||||
// stopped a search, but we also send the apprt end_search so
|
||||
|
||||
Reference in New Issue
Block a user