Skip to content

Commit

Permalink
feat: new load DDS event
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Dec 2, 2024
1 parent 20dc055 commit 0a78117
Show file tree
Hide file tree
Showing 79 changed files with 167 additions and 206 deletions.
184 changes: 72 additions & 112 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ crossterm = { version = "0.28.1", features = [ "event-stream" ] }
dirs = "5.0.1"
futures = "0.3.31"
globset = "0.4.15"
libc = "0.2.166"
libc = "0.2.167"
md-5 = "0.10.6"
mlua = { version = "0.10.1", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
mlua = { version = "0.10.2", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
parking_lot = "0.12.3"
ratatui = { version = "0.29.0", features = [ "unstable-rendered-line-info" ] }
regex = "1.11.1"
Expand Down
2 changes: 1 addition & 1 deletion yazi-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ proc-macro = true

[dependencies]
# External dependencies
syn = "2.0.89"
syn = "2.0.90"
quote = "1.0.37"
2 changes: 1 addition & 1 deletion yazi-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anyhow = { workspace = true }
bitflags = { workspace = true }
crossterm = { workspace = true }
globset = { workspace = true }
indexmap = { version = "2.6.0", features = [ "serde" ] }
indexmap = { version = "2.7.0", features = [ "serde" ] }
ratatui = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions yazi-config/src/popup/options.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ratatui::{text::Text, widgets::{Paragraph, Wrap}};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::{Offset, Origin, Position};
use crate::{CONFIRM, INPUT, PICK};
Expand Down Expand Up @@ -119,7 +119,7 @@ impl ConfirmCfg {
}
}

pub fn trash(urls: &[yazi_shared::fs::Url]) -> Self {
pub fn trash(urls: &[yazi_shared::url::Url]) -> Self {
Self::new(
Self::replace_number(&CONFIRM.trash_title, urls.len()),
(CONFIRM.trash_origin, CONFIRM.trash_offset),
Expand All @@ -128,7 +128,7 @@ impl ConfirmCfg {
)
}

pub fn delete(urls: &[yazi_shared::fs::Url]) -> Self {
pub fn delete(urls: &[yazi_shared::url::Url]) -> Self {
Self::new(
Self::replace_number(&CONFIRM.delete_title, urls.len()),
(CONFIRM.delete_origin, CONFIRM.delete_offset),
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/bulk_rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tokio::{fs::{self, OpenOptions}, io::{AsyncReadExt, AsyncWriteExt, stdin}};
use yazi_config::{OPEN, PREVIEW};
use yazi_dds::Pubsub;
use yazi_proxy::{AppProxy, HIDER, TasksProxy, WATCHER};
use yazi_shared::{fs::{File, FilesOp, Url, max_common_root, maybe_exists, paths_to_same_file}, terminal_clear};
use yazi_shared::{fs::{File, FilesOp, max_common_root, maybe_exists, paths_to_same_file}, terminal_clear, url::Url};

use crate::manager::Manager;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::Result;
use tokio::fs;
use yazi_config::popup::{ConfirmCfg, InputCfg};
use yazi_proxy::{ConfirmProxy, InputProxy, TabProxy, WATCHER};
use yazi_shared::{event::CmdCow, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_or_not_found, realname}};
use yazi_shared::{event::CmdCow, fs::{File, FilesOp, maybe_exists, ok_or_not_found, realname}, url::{Url, UrnBuf}};

use crate::manager::Manager;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashSet, path::PathBuf};

use yazi_dds::Pubsub;
use yazi_macro::render;
use yazi_shared::{Id, event::{CmdCow, Data}, fs::{Url, Urn}};
use yazi_shared::{Id, event::{CmdCow, Data}, url::{Url, Urn}};

use crate::manager::Manager;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use yazi_fs::Folder;
use yazi_macro::emit;
use yazi_plugin::isolate;
use yazi_proxy::{ManagerProxy, TasksProxy, options::OpenDoOpt};
use yazi_shared::{MIME_DIR, event::{CmdCow, EventQuit}, fs::{File, Url}};
use yazi_shared::{MIME_DIR, event::{CmdCow, EventQuit}, fs::File, url::Url};

use crate::{manager::Manager, tasks::Tasks};

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/peek.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use yazi_proxy::HIDER;
use yazi_shared::{event::{CmdCow, Data}, fs::Url};
use yazi_shared::{event::{CmdCow, Data}, url::Url};

use crate::manager::Manager;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/remove.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use yazi_config::popup::ConfirmCfg;
use yazi_proxy::{ConfirmProxy, ManagerProxy};
use yazi_shared::{event::CmdCow, fs::Url};
use yazi_shared::{event::CmdCow, url::Url};

use crate::{manager::Manager, tasks::Tasks};

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tokio::fs;
use yazi_config::popup::{ConfirmCfg, InputCfg};
use yazi_dds::Pubsub;
use yazi_proxy::{ConfirmProxy, InputProxy, TabProxy, WATCHER};
use yazi_shared::{event::CmdCow, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_or_not_found, paths_to_same_file, realname}};
use yazi_shared::{event::CmdCow, fs::{File, FilesOp, maybe_exists, ok_or_not_found, paths_to_same_file, realname}, url::{Url, UrnBuf}};

use crate::manager::Manager;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/tab_create.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use yazi_boot::BOOT;
use yazi_macro::render;
use yazi_proxy::AppProxy;
use yazi_shared::{event::CmdCow, fs::Url};
use yazi_shared::{event::CmdCow, url::Url};

use crate::{manager::Tabs, tab::Tab};

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/update_mimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::HashMap};

use tracing::error;
use yazi_macro::render;
use yazi_shared::{event::CmdCow, fs::Url};
use yazi_shared::{event::CmdCow, url::Url};

use crate::{manager::{LINKED, Manager}, tasks::Tasks};

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/update_paged.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use yazi_shared::{event::{CmdCow, Data}, fs::Url};
use yazi_shared::{event::{CmdCow, Data}, url::Url};

use crate::{manager::Manager, tasks::Tasks};

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/update_tasks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use yazi_shared::{event::CmdCow, fs::Url};
use yazi_shared::{event::CmdCow, url::Url};

use crate::manager::Manager;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/commands/update_yanked.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashSet;

use yazi_macro::render;
use yazi_shared::{event::CmdCow, fs::Url};
use yazi_shared::{event::CmdCow, url::Url};

use crate::manager::{Manager, Yanked};

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/linked.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashMap, ops::{Deref, DerefMut}};

use yazi_shared::fs::Url;
use yazi_shared::url::Url;

#[derive(Default)]
pub struct Linked(HashMap<Url, Url> /* from ==> to */);
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ratatui::layout::Rect;
use yazi_adapter::Dimension;
use yazi_config::popup::{Origin, Position};
use yazi_fs::Folder;
use yazi_shared::{Id, fs::{File, Url}};
use yazi_shared::{Id, fs::File, url::Url};

use super::{Mimetype, Tabs, Watcher, Yanked};
use crate::tab::Tab;
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/mimetype.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashMap, path::PathBuf};

use yazi_shared::fs::{Url, UrlScheme};
use yazi_shared::url::{Url, UrlScheme};

#[derive(Default)]
pub struct Mimetype(HashMap<PathBuf, String>);
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::{Deref, DerefMut};
use yazi_boot::BOOT;
use yazi_dds::Pubsub;
use yazi_proxy::ManagerProxy;
use yazi_shared::{Id, fs::Url};
use yazi_shared::{Id, url::Url};

use crate::tab::Tab;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use yazi_config::PLUGIN;
use yazi_fs::{Files, Folder};
use yazi_plugin::isolate;
use yazi_proxy::WATCHER;
use yazi_shared::{RoCell, event::CmdCow, fs::{Cha, File, FilesOp, Url, realname_unchecked}};
use yazi_shared::{RoCell, event::CmdCow, fs::{Cha, File, FilesOp, realname_unchecked}, url::Url};

use super::Linked;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/manager/yanked.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashSet, ops::Deref};

use yazi_dds::Pubsub;
use yazi_shared::fs::{FilesOp, Url};
use yazi_shared::{fs::FilesOp, url::Url};

#[derive(Default)]
pub struct Yanked {
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/spot/spot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::borrow::Cow;
use tokio_util::sync::CancellationToken;
use yazi_config::PLUGIN;
use yazi_plugin::{isolate, utils::SpotLock};
use yazi_shared::fs::{File, Url};
use yazi_shared::{fs::File, url::Url};

#[derive(Default)]
pub struct Spot {
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/commands/cd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use yazi_config::popup::InputCfg;
use yazi_dds::Pubsub;
use yazi_macro::render;
use yazi_proxy::{CompletionProxy, InputProxy, ManagerProxy, TabProxy};
use yazi_shared::{Debounce, errors::InputError, event::CmdCow, fs::{Url, expand_path}};
use yazi_shared::{Debounce, errors::InputError, event::CmdCow, fs::expand_path, url::Url};

use crate::tab::Tab;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/commands/reveal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use yazi_proxy::ManagerProxy;
use yazi_shared::{event::CmdCow, fs::{File, FilesOp, Url, expand_path}};
use yazi_shared::{event::CmdCow, fs::{File, FilesOp, expand_path}, url::Url};

use crate::tab::Tab;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/commands/toggle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use yazi_macro::render_and;
use yazi_proxy::AppProxy;
use yazi_shared::{event::CmdCow, fs::Url};
use yazi_shared::{event::CmdCow, url::Url};

use crate::tab::Tab;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashMap;

use anyhow::Result;
use yazi_fs::{Files, Filter, FilterCase};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

pub struct Finder {
pub filter: Filter,
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/history.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, ops::{Deref, DerefMut}};

use yazi_fs::Folder;
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

#[derive(Default)]
pub struct History(HashMap<Url, Folder>);
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use yazi_config::PLUGIN;
use yazi_fs::Files;
use yazi_macro::render;
use yazi_plugin::{external::Highlighter, isolate, utils::PreviewLock};
use yazi_shared::{MIME_DIR, fs::{Cha, File, FilesOp, Url}};
use yazi_shared::{MIME_DIR, fs::{Cha, File, FilesOp}, url::Url};

#[derive(Default)]
pub struct Preview {
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/selected.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashMap, ops::Deref};

use yazi_shared::{fs::{FilesOp, Url}, timestamp_us};
use yazi_shared::{fs::FilesOp, timestamp_us, url::Url};

#[derive(Default)]
pub struct Selected {
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tab/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use yazi_adapter::Dimension;
use yazi_config::{LAYOUT, popup::{Origin, Position}};
use yazi_fs::{Folder, FolderStage};
use yazi_macro::render;
use yazi_shared::{Id, Ids, fs::{File, Url}};
use yazi_shared::{Id, Ids, fs::File, url::Url};

use super::{Backstack, Finder, History, Mode, Preference, Preview};
use crate::{spot::Spot, tab::Selected};
Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tasks/file.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashSet;

use tracing::debug;
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Tasks;

Expand Down
2 changes: 1 addition & 1 deletion yazi-core/src/tasks/process.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{borrow::Cow, collections::HashMap, ffi::OsString, mem};

use yazi_config::{OPEN, open::Opener};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Tasks;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::{HashMap, hash_map}};

use mlua::{AnyUserData, IntoLua, IntoLuaMulti, Lua, MetaMethod, UserData, UserDataRefMut, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/cd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Cow;

use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::{Id, fs::Url};
use yazi_shared::{Id, url::Url};

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Cow;

use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Cow;

use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::{Id, fs::Url};
use yazi_shared::{Id, url::Url};

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/move_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Cow;

use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Cow;

use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/trash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Cow;

use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/body/yank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::HashSet};

use mlua::{IntoLua, Lua, MetaMethod, UserData, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::fs::Url;
use yazi_shared::url::Url;

use super::Body;

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet};
use mlua::Function;
use parking_lot::RwLock;
use yazi_boot::BOOT;
use yazi_shared::{Id, RoCell, fs::Url};
use yazi_shared::{Id, RoCell, url::Url};

use crate::{Client, ID, PEERS, body::{Body, BodyBulk, BodyCd, BodyDelete, BodyHi, BodyHover, BodyMove, BodyMoveItem, BodyRename, BodyTab, BodyTrash, BodyYank}};

Expand Down
2 changes: 1 addition & 1 deletion yazi-dds/src/pump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use parking_lot::Mutex;
use tokio::{pin, select, sync::mpsc};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use tokio_util::sync::CancellationToken;
use yazi_shared::{RoCell, fs::Url};
use yazi_shared::{RoCell, url::Url};

use crate::{Pubsub, body::BodyMoveItem};

Expand Down
Loading

0 comments on commit 0a78117

Please sign in to comment.