Add ctrl+f for review tool.

This commit is contained in:
Greyson Parrelli
2026-08-25 09:35:25 -04:00
parent 071522f67c
commit 07ed03b570
5 changed files with 375 additions and 264 deletions
+13 -3
View File
@@ -18,6 +18,7 @@ const Browser = @import("Browser.zig");
const Layouts = @import("Layouts.zig");
const OpenLayoutDialog = @import("OpenLayoutDialog.zig");
const Pane = @import("Pane.zig");
const Review = @import("Review.zig");
const SaveLayoutDialog = @import("SaveLayoutDialog.zig");
const Settings = @import("Settings.zig");
const SettingsDialog = @import("SettingsDialog.zig");
@@ -1860,6 +1861,11 @@ fn focusedBrowser(self: *Window) ?*Browser {
return tab.view.focusedBrowser();
}
fn focusedReview(self: *Window) ?*Review {
const tab = self.activeTab() orelse return null;
return tab.view.focusedReview();
}
/// Split the visible tab's focused pane, adding a pane of the given kind.
fn addPane(self: *Window, kind: View.Kind) void {
const tab = self.activeTab() orelse return;
@@ -2126,10 +2132,14 @@ fn perform(self: *Window, action: shortcuts.Action) bool {
// Find-in-page, on the chord every browser uses. In a terminal Ctrl+F
// is an ordinary control character that the program running there is
// waiting for, so this only claims the key over a web pane.
// waiting for, so this only claims the key over a pane holding a page.
// Both kinds that do put up the same bar.
.find => {
const browser = self.focusedBrowser() orelse return false;
browser.openFind();
if (self.focusedBrowser()) |browser| {
browser.openFind();
} else if (self.focusedReview()) |pane| {
pane.openFind();
} else return false;
},
.prev_tab => self.cycle(-1),