Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 198 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tui-popup = "0.3.1"
clap = { version = "4.5.4", features = ["derive", "env", "wrap_help", "cargo"] }
clap_complete = "4.5.2"
clap_mangen = "0.2.20"
webbrowser = "1.0.1"

[profile.dev]
opt-level = 0
Expand Down
16 changes: 16 additions & 0 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ pub fn handle_key_events(
app.quit();
}
}
KeyCode::Char(' ') => {
if app.show_details {
let references = &app.list.selected().unwrap().references;
// Iterates over the references and find the first http reference, if any
if let Some(first_http_reference) =
references.iter().find(|r| r.starts_with("http"))
{
match webbrowser::open(first_http_reference) {
Ok(_) => {} // Opened the browser successfully, nothing to do
Err(err) => {
println!("Failed to open browser: {err:?}");
}
}
}
}
}
KeyCode::Down | KeyCode::Char('j') => {
if app.show_details && app.scroll_details {
app.scroll_index = app.scroll_index.saturating_add(1);
Expand Down