mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-22 00:51:23 +00:00
config: default search keybindings for macos
This commit is contained in:
@@ -4896,7 +4896,15 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
||||
const s: *Search = if (self.search) |*s| s else init: {
|
||||
// If we're stopping the search and we had no prior search,
|
||||
// then there is nothing to do.
|
||||
if (text.len == 0) return false;
|
||||
if (text.len == 0) {
|
||||
// So GUIs can hide visible search widgets.
|
||||
_ = try self.rt_app.performAction(
|
||||
.{ .surface = self },
|
||||
.end_search,
|
||||
{},
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to assign directly to self.search because we need
|
||||
// a stable pointer back to the thread state.
|
||||
|
||||
@@ -6410,12 +6410,30 @@ pub const Keybinds = struct {
|
||||
.start_search,
|
||||
.{ .performable = true },
|
||||
);
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
.{ .key = .{ .unicode = 'f' }, .mods = .{ .super = true, .shift = true } },
|
||||
.{ .search = "" },
|
||||
.{ .performable = true },
|
||||
);
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
.{ .key = .{ .physical = .escape } },
|
||||
.{ .search = "" },
|
||||
.{ .performable = true },
|
||||
);
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
.{ .key = .{ .unicode = 'g' }, .mods = .{ .super = true } },
|
||||
.{ .navigate_search = .next },
|
||||
.{ .performable = true },
|
||||
);
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
.{ .key = .{ .unicode = 'g' }, .mods = .{ .super = true, .shift = true } },
|
||||
.{ .navigate_search = .previous },
|
||||
.{ .performable = true },
|
||||
);
|
||||
|
||||
// Inspector, matching Chromium
|
||||
try self.set.put(
|
||||
|
||||
Reference in New Issue
Block a user