mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: pass through show_hidden when building default Files (#2057)
This commit is contained in:
parent
f4eef99f7e
commit
c96b1d3aa1
3 changed files with 17 additions and 2 deletions
|
|
@ -6,7 +6,6 @@ use yazi_fs::{Cha, File, Files, FilesOp, FolderStage, Step};
|
||||||
use yazi_proxy::ManagerProxy;
|
use yazi_proxy::ManagerProxy;
|
||||||
use yazi_shared::{Id, url::{Url, Urn}};
|
use yazi_shared::{Id, url::{Url, Urn}};
|
||||||
|
|
||||||
#[derive(Default)]
|
|
||||||
pub struct Folder {
|
pub struct Folder {
|
||||||
pub url: Url,
|
pub url: Url,
|
||||||
pub cha: Cha,
|
pub cha: Cha,
|
||||||
|
|
@ -20,6 +19,21 @@ pub struct Folder {
|
||||||
pub tracing: bool,
|
pub tracing: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Folder {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
url: Default::default(),
|
||||||
|
cha: Default::default(),
|
||||||
|
files: Files::new(MANAGER.show_hidden),
|
||||||
|
stage: Default::default(),
|
||||||
|
offset: Default::default(),
|
||||||
|
cursor: Default::default(),
|
||||||
|
page: Default::default(),
|
||||||
|
tracing: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<&Url> for Folder {
|
impl From<&Url> for Folder {
|
||||||
fn from(url: &Url) -> Self { Self { url: url.clone(), ..Default::default() } }
|
fn from(url: &Url) -> Self { Self { url: url.clone(), ..Default::default() } }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ impl Deref for Files {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Files {
|
impl Files {
|
||||||
|
pub fn new(show_hidden: bool) -> Self { Self { show_hidden, ..Default::default() } }
|
||||||
|
|
||||||
pub async fn from_dir(dir: &Url) -> std::io::Result<UnboundedReceiver<File>> {
|
pub async fn from_dir(dir: &Url) -> std::io::Result<UnboundedReceiver<File>> {
|
||||||
let mut it = fs::read_dir(dir).await?;
|
let mut it = fs::read_dir(dir).await?;
|
||||||
let (tx, rx) = mpsc::unbounded_channel();
|
let (tx, rx) = mpsc::unbounded_channel();
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ local function setup(_, opts)
|
||||||
function()
|
function()
|
||||||
ya.manager_emit("shell", {
|
ya.manager_emit("shell", {
|
||||||
orphan = true,
|
orphan = true,
|
||||||
confirm = true,
|
|
||||||
"zoxide add " .. ya.quote(tostring(cx.active.current.cwd)),
|
"zoxide add " .. ya.quote(tostring(cx.active.current.cwd)),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue