QOL shortcuts
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -199,6 +199,16 @@ impl eframe::App for LogViewerApp {
|
||||
self.handle_close_tab(index);
|
||||
}
|
||||
|
||||
// Check for Ctrl+F keyboard shortcut
|
||||
let ctrl_f_pressed = ctx.input(|i| {
|
||||
i.modifiers.ctrl && i.key_pressed(egui::Key::F)
|
||||
});
|
||||
|
||||
// Check for Ctrl+Enter to execute search globally
|
||||
let ctrl_enter_pressed = ctx.input(|i| {
|
||||
i.modifiers.ctrl && i.key_pressed(egui::Key::Enter)
|
||||
});
|
||||
|
||||
// Render search panel
|
||||
let match_count = self.active_tab().map(|t| t.filtered_lines.len()).unwrap_or(0);
|
||||
let search_actions = render_search_panel(
|
||||
@@ -206,9 +216,10 @@ impl eframe::App for LogViewerApp {
|
||||
&mut self.search_panel_state,
|
||||
&self.search_state,
|
||||
match_count,
|
||||
ctrl_f_pressed,
|
||||
);
|
||||
|
||||
if search_actions.execute_search {
|
||||
if search_actions.execute_search || ctrl_enter_pressed {
|
||||
add_to_history(
|
||||
&mut self.search_panel_state.history,
|
||||
&self.search_panel_state.query,
|
||||
|
||||
Reference in New Issue
Block a user