remove dead click_link method from terminal host
This is now handled by the gui layer
This commit is contained in:
1 parent
cdbb131833
commit
f125bd863a
5 files changed
-33
No files matched your search
@@ -177,19 +177,6 @@ impl<'a> term::TerminalHost for Host<'a> {
|
||||
fn set_title(&mut self, title: &str) {
|
||||
self.context.set_title(title);
|
||||
}
|
||||
|
||||
fn click_link(&mut self, link: &Arc<term::cell::Hyperlink>) {
|
||||
// Ensure that we spawn the `open` call outside of the context
|
||||
// of our window loop; on Windows it can cause a panic due to
|
||||
// triggering our WndProc recursively.
|
||||
let link = link.clone();
|
||||
promise::spawn::spawn(async move {
|
||||
log::error!("clicking {}", link.uri());
|
||||
if let Err(err) = open::that(link.uri()) {
|
||||
log::error!("failed to open {}: {:?}", link.uri(), err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
enum Key {
|
||||
|
||||
@@ -14,7 +14,6 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use term::TerminalHost;
|
||||
use termwiz::hyperlink::Hyperlink;
|
||||
use thiserror::*;
|
||||
|
||||
pub mod domain;
|
||||
@@ -107,13 +106,6 @@ impl<'a> TerminalHost for Host<'a> {
|
||||
&mut self.writer
|
||||
}
|
||||
|
||||
fn click_link(&mut self, link: &Arc<Hyperlink>) {
|
||||
match open::that(link.uri()) {
|
||||
Ok(_) => {}
|
||||
Err(err) => error!("failed to open {}: {:?}", link.uri(), err),
|
||||
}
|
||||
}
|
||||
|
||||
fn set_title(&mut self, _title: &str) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,13 +170,6 @@ impl<'a> term::TerminalHost for BufferedTerminalHost<'a> {
|
||||
&mut *self.write
|
||||
}
|
||||
|
||||
fn click_link(&mut self, link: &Arc<term::cell::Hyperlink>) {
|
||||
log::error!(
|
||||
"nothing should call BufferedTerminalHost::click_link, but something did with {:?}",
|
||||
link
|
||||
);
|
||||
}
|
||||
|
||||
fn set_title(&mut self, title: &str) {
|
||||
self.title.replace(title.to_owned());
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ pub trait TerminalHost {
|
||||
/// Change the title of the window
|
||||
fn set_title(&mut self, title: &str);
|
||||
|
||||
/// Called when a URL is clicked
|
||||
fn click_link(&mut self, link: &Arc<Hyperlink>);
|
||||
|
||||
/// Switch to a specific tab
|
||||
fn activate_tab(&mut self, _tab: usize) {}
|
||||
|
||||
|
||||
@@ -72,8 +72,6 @@ impl TerminalHost for TestHost {
|
||||
fn writer(&mut self) -> &mut dyn std::io::Write {
|
||||
self
|
||||
}
|
||||
|
||||
fn click_link(&mut self, _link: &Arc<Hyperlink>) {}
|
||||
}
|
||||
|
||||
struct TestTerm {
|
||||
|
||||
Reference in new issue
Block a user