diff --git a/src/Surface.zig b/src/Surface.zig index 55a96c02e..0e91b4083 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -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. diff --git a/src/config/Config.zig b/src/config/Config.zig index 85e777349..e34666ecb 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -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(