From 8ef7e1f2b935612611455315300d584db2f808ee Mon Sep 17 00:00:00 2001 From: Carlos de Paula Date: Sun, 4 Jan 2026 19:31:29 -0300 Subject: [PATCH] Fixes for the upstream merge --- yazi-actor/src/mgr/exclude_add.rs | 12 ++++++------ yazi-actor/src/mgr/excluded.rs | 4 ++-- yazi-actor/src/mgr/ignore.rs | 12 ++++++------ yazi-fs/src/ignore.rs | 2 +- yazi-shared/src/url/buf.rs | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/yazi-actor/src/mgr/exclude_add.rs b/yazi-actor/src/mgr/exclude_add.rs index 5a07ee5e..6e980869 100644 --- a/yazi-actor/src/mgr/exclude_add.rs +++ b/yazi-actor/src/mgr/exclude_add.rs @@ -7,7 +7,7 @@ use yazi_core::tab::Folder; use yazi_fs::{FolderStage, IgnoreFilter}; use yazi_macro::{act, render, render_and, succ}; use yazi_parser::mgr::ExcludeAddOpt; -use yazi_shared::{data::Data, path::PathLike, url::UrlLike}; +use yazi_shared::{data::Data, url::UrlLike}; use crate::{Actor, Ctx}; @@ -28,12 +28,12 @@ impl Actor for ExcludeAdd { let cwd_str = if cwd.is_search() { "search://**".to_string() } else { - cwd.as_path().map(|p| p.display().to_string()).unwrap_or_default() + cwd.loc().as_os().ok().map(|p| p.display().to_string()).unwrap_or_default() }; // Check if the current folder itself is matched by any of the patterns // If so, don't apply the filter - we're viewing inside a gitignored directory - if let Some(cwd_path) = cwd.as_path() { + if let Some(cwd_path) = cwd.loc().as_os().ok() { // Build a quick GlobSet to test if current folder matches any pattern let mut test_builder = GlobSetBuilder::new(); for pattern in &opt.patterns { @@ -154,7 +154,7 @@ impl Actor for ExcludeAdd { // Load ignore filter with merged patterns let ignore_filter = IgnoreFilter::from_patterns(glob_matcher.clone()); - let hovered = cx.hovered().map(|f| f.urn().owned()); + let hovered = cx.hovered().map(|f| f.urn().to_owned()); let apply = |f: &mut Folder, filter: Option| { let changed = f.files.set_ignore_filter(filter); if f.stage == FolderStage::Loading { @@ -172,7 +172,7 @@ impl Actor for ExcludeAdd { let parent_str = if p.url.is_search() { "search://**".to_string() } else { - p.url.as_path().map(|p| p.display().to_string()).unwrap_or_default() + p.url.loc().as_os().ok().map(|p| p.display().to_string()).unwrap_or_default() }; let parent_config_patterns = YAZI.files.excludes_for_context(&parent_str); @@ -265,7 +265,7 @@ impl Actor for ExcludeAdd { let hovered_str = if h.url.is_search() { "search://**".to_string() } else { - h.url.as_path().map(|p| p.display().to_string()).unwrap_or_default() + h.url.loc().as_os().ok().map(|p| p.display().to_string()).unwrap_or_default() }; let hovered_config_patterns = YAZI.files.excludes_for_context(&hovered_str); diff --git a/yazi-actor/src/mgr/excluded.rs b/yazi-actor/src/mgr/excluded.rs index b01e0468..2000ac32 100644 --- a/yazi-actor/src/mgr/excluded.rs +++ b/yazi-actor/src/mgr/excluded.rs @@ -3,7 +3,7 @@ use yazi_core::tab::Folder; use yazi_fs::FolderStage; use yazi_macro::{act, render, render_and, succ}; use yazi_parser::mgr::ExcludedOpt; -use yazi_shared::{data::Data, path::PathLike}; +use yazi_shared::data::Data; use crate::{Actor, Ctx}; @@ -18,7 +18,7 @@ impl Actor for Excluded { let current_state = cx.tab().current.files.show_excluded(); let state = opt.state.bool(current_state); - let hovered = cx.hovered().map(|f| f.urn().owned()); + let hovered = cx.hovered().map(|f| f.urn().to_owned()); let apply = |f: &mut Folder| { if f.stage == FolderStage::Loading { render!(); diff --git a/yazi-actor/src/mgr/ignore.rs b/yazi-actor/src/mgr/ignore.rs index 047ba0d2..5c2ca0d3 100644 --- a/yazi-actor/src/mgr/ignore.rs +++ b/yazi-actor/src/mgr/ignore.rs @@ -6,7 +6,7 @@ use yazi_core::tab::Folder; use yazi_fs::{FolderStage, IgnoreFilter}; use yazi_macro::{act, render, render_and, succ}; use yazi_parser::VoidOpt; -use yazi_shared::{data::Data, path::PathLike, url::UrlLike}; +use yazi_shared::{data::Data, url::UrlLike}; use crate::{Actor, Ctx}; @@ -24,14 +24,14 @@ impl Actor for Ignore { let cwd_str = if cwd.is_search() { "search://**".to_string() } else { - cwd.as_path().map(|p| p.display().to_string()).unwrap_or_default() + cwd.loc().as_os().ok().map(|p| p.display().to_string()).unwrap_or_default() }; let exclude_patterns = YAZI.files.excludes_for_context(&cwd_str); // Check if we're inside an excluded directory // If so, don't apply filters to allow viewing excluded directory contents - if let Some(cwd_path) = cwd.as_path() { + if let Some(cwd_path) = cwd.loc().as_os().ok() { // Quick test: does the CWD match any exclude pattern? for pattern in &exclude_patterns { if pattern.starts_with('!') { @@ -62,7 +62,7 @@ impl Actor for Ignore { // Load ignore filter from exclude patterns let ignore_filter = IgnoreFilter::from_patterns(glob_matcher.clone()); - let hovered = cx.hovered().map(|f| f.urn().owned()); + let hovered = cx.hovered().map(|f| f.urn().to_owned()); let apply = |f: &mut Folder, filter: Option| { // Always set the filter, even when loading let changed = f.files.set_ignore_filter(filter); @@ -81,7 +81,7 @@ impl Actor for Ignore { let parent_str = if p.url.is_search() { "search://**".to_string() } else { - p.url.as_path().map(|p| p.display().to_string()).unwrap_or_default() + p.url.loc().as_os().ok().map(|p| p.display().to_string()).unwrap_or_default() }; let parent_excludes = YAZI.files.excludes_for_context(&parent_str); @@ -109,7 +109,7 @@ impl Actor for Ignore { let hovered_str = if h.url.is_search() { "search://**".to_string() } else { - h.url.as_path().map(|p| p.display().to_string()).unwrap_or_default() + h.url.loc().as_os().ok().map(|p| p.display().to_string()).unwrap_or_default() }; let hovered_excludes = YAZI.files.excludes_for_context(&hovered_str); let hovered_matcher: Option Option + Send + Sync>> = diff --git a/yazi-fs/src/ignore.rs b/yazi-fs/src/ignore.rs index a5803de3..d332f525 100644 --- a/yazi-fs/src/ignore.rs +++ b/yazi-fs/src/ignore.rs @@ -59,7 +59,7 @@ impl IgnoreFilter { /// Returns true if matched as ignore, false if whitelisted or no match. pub fn matches_url(&self, url: impl AsUrl) -> bool { let url = url.as_url(); - let path = url.loc.as_path(); + let Ok(path) = url.loc().as_os() else { return false }; // Check glob matcher if let Some(ref matcher) = self.glob_matcher { diff --git a/yazi-shared/src/url/buf.rs b/yazi-shared/src/url/buf.rs index 3acfca56..3f8ed6a3 100644 --- a/yazi-shared/src/url/buf.rs +++ b/yazi-shared/src/url/buf.rs @@ -162,7 +162,7 @@ impl UrlBuf { Self::Archive { loc, domain } => { Self::Archive { loc: loc.rebase(base), domain: domain.clone() } } - Self::Sftp { loc, domain } => { + Self::Sftp { loc: _, domain: _ } => { todo!(); // Self::Sftp { loc: loc.rebase(base), domain: domain.clone() } }