Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions yazi-config/src/manager/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ pub struct Manager {
pub scrolloff: u8,
pub mouse_events: MouseEvents,
pub title_format: String,

// TODO: remove this in Yazi 0.4.2
#[serde(default)]
pub _v4_suppress_deprecation_warnings: bool,
}

impl FromStr for Manager {
Expand Down
3 changes: 1 addition & 2 deletions yazi-plugin/src/bindings/cha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ impl<T: Into<yazi_fs::Cha>> From<T> for Cha {
fn from(cha: T) -> Self { Self(cha.into()) }
}

static WARNED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);

#[inline]
fn warn_deprecated(id: Option<&str>) {
static WARNED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
if !WARNED.swap(true, std::sync::atomic::Ordering::Relaxed) {
let id = match id {
Some(id) => format!("`{id}.yazi` plugin"),
Expand Down
5 changes: 5 additions & 0 deletions yazi-proxy/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::time::Duration;

use tokio::sync::oneshot;
use yazi_config::MANAGER;
use yazi_macro::emit;
use yazi_shared::{Layer, event::Cmd};

Expand All @@ -23,6 +24,10 @@ impl AppProxy {

#[inline]
pub fn notify(opt: NotifyOpt) {
if MANAGER._v4_suppress_deprecation_warnings && opt.title.contains("Deprecated") {
return;
}

emit!(Call(Cmd::new("notify").with_any("option", opt), Layer::App));
}

Expand Down
Loading