mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: enter and leave commands should treat the search results as regular entities (#1687)
This commit is contained in:
parent
5b66192332
commit
c4ffdc08bb
6 changed files with 7 additions and 10 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
use yazi_shared::{event::{Cmd, Data}, fs::Url, render};
|
use yazi_shared::{event::{Cmd, Data}, fs::Url};
|
||||||
|
|
||||||
use crate::manager::Manager;
|
use crate::manager::Manager;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use yazi_config::PLUGIN;
|
use yazi_config::PLUGIN;
|
||||||
use yazi_plugin::isolate;
|
use yazi_plugin::isolate;
|
||||||
use yazi_shared::{MIME_DIR, event::{Cmd, Data}, render};
|
use yazi_shared::{MIME_DIR, event::{Cmd, Data}};
|
||||||
|
|
||||||
use crate::manager::Manager;
|
use crate::manager::Manager;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,11 @@ impl Tabs {
|
||||||
} else if let Some(h) = self.active().current.hovered() {
|
} else if let Some(h) = self.active().current.hovered() {
|
||||||
tab.conf = self.active().conf.clone();
|
tab.conf = self.active().conf.clone();
|
||||||
tab.apply_files_attrs();
|
tab.apply_files_attrs();
|
||||||
tab.reveal(h.url_owned());
|
tab.reveal(h.url.to_regular());
|
||||||
} else {
|
} else {
|
||||||
tab.conf = self.active().conf.clone();
|
tab.conf = self.active().conf.clone();
|
||||||
tab.apply_files_attrs();
|
tab.apply_files_attrs();
|
||||||
tab.cd(self.active().cwd().to_owned());
|
tab.cd(self.active().cwd().to_regular());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.items.insert(self.cursor + 1, tab);
|
self.items.insert(self.cursor + 1, tab);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@ use crate::tab::Tab;
|
||||||
|
|
||||||
impl Tab {
|
impl Tab {
|
||||||
pub fn enter(&mut self, _: Cmd) {
|
pub fn enter(&mut self, _: Cmd) {
|
||||||
self.current.hovered().filter(|h| h.is_dir()).map(|h| h.url_owned()).map(|u| self.cd(u));
|
self.current.hovered().filter(|h| h.is_dir()).map(|h| h.url.to_regular()).map(|u| self.cd(u));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ impl Tab {
|
||||||
self
|
self
|
||||||
.current
|
.current
|
||||||
.hovered()
|
.hovered()
|
||||||
.and_then(|h| h.parent())
|
.and_then(|h| h.url.parent_url())
|
||||||
.filter(|u| u != self.cwd())
|
.filter(|u| u != self.cwd())
|
||||||
.or_else(|| self.cwd().parent_url())
|
.or_else(|| self.cwd().parent_url())
|
||||||
.map(|u| self.cd(u));
|
.map(|u| self.cd(u.into_regular()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,4 @@ impl File {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn stem(&self) -> Option<&OsStr> { self.url.file_stem() }
|
pub fn stem(&self) -> Option<&OsStr> { self.url.file_stem() }
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn parent(&self) -> Option<Url> { self.url.parent_url() }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue