mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
7de161de5c
commit
1be8f2c307
4 changed files with 12 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ impl Tabs {
|
|||
return;
|
||||
}
|
||||
|
||||
self.items.remove(opt.idx);
|
||||
self.items.remove(opt.idx).shutdown();
|
||||
if opt.idx <= self.idx {
|
||||
self.set_idx(self.absolute(1));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ impl Manager {
|
|||
mimetype: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn shutdown(&mut self) { self.tabs.iter_mut().for_each(|t| t.shutdown()); }
|
||||
}
|
||||
|
||||
impl Manager {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,14 @@ impl From<&Url> for Tab {
|
|||
fn from(url: &Url) -> Self { Self::from(url.clone()) }
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
pub fn shutdown(&mut self) {
|
||||
if let Some(handle) = self.search.take() {
|
||||
handle.abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
// --- Current
|
||||
pub fn selected_or_hovered(&self) -> Vec<&Url> {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use crate::app::App;
|
|||
impl App {
|
||||
pub(crate) fn quit(&mut self, opt: EventQuit) -> ! {
|
||||
self.cx.tasks.shutdown();
|
||||
self.cx.manager.shutdown();
|
||||
|
||||
if !opt.no_cwd_file {
|
||||
self.cwd_to_file();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue