mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
a4629adc30
commit
de3623bbb9
99 changed files with 185 additions and 192 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
use serde::Deserialize;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use super::Key;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::fmt;
|
|||
|
||||
use anyhow::{bail, Result};
|
||||
use serde::{de::{self, Visitor}, Deserializer};
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
pub(super) fn exec_deserialize<'de, D>(deserializer: D) -> Result<Vec<Exec>, D::Error>
|
||||
where
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::completion::Completion;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{completion::Completion, emit, input::Input};
|
||||
use crate::{completion::Completion, input::Input};
|
||||
|
||||
pub struct Opt {
|
||||
submit: bool,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::{mem, ops::ControlFlow};
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::completion::Completion;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use std::{mem, path::{MAIN_SEPARATOR, MAIN_SEPARATOR_STR}};
|
||||
|
||||
use tokio::fs;
|
||||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{completion::Completion, emit};
|
||||
use crate::completion::Completion;
|
||||
|
||||
pub struct Opt<'a> {
|
||||
word: &'a str,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use ratatui::prelude::Rect;
|
||||
use tokio::sync::oneshot;
|
||||
use yazi_config::popup::{Origin, Position};
|
||||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{completion::Completion, emit, help::Help, input::Input, manager::Manager, select::Select, tasks::Tasks, which::Which};
|
||||
use crate::{completion::Completion, help::Help, input::Input, manager::Manager, select::Select, tasks::Tasks, which::Which};
|
||||
|
||||
pub struct Ctx {
|
||||
pub manager: Manager,
|
||||
|
|
|
|||
4
yazi-core/src/external/fd.rs
vendored
4
yazi-core/src/external/fd.rs
vendored
|
|
@ -2,9 +2,7 @@ use std::process::Stdio;
|
|||
|
||||
use anyhow::Result;
|
||||
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}};
|
||||
use yazi_shared::fs::Url;
|
||||
|
||||
use crate::files::File;
|
||||
use yazi_shared::{files::File, fs::Url};
|
||||
|
||||
pub struct FdOpt {
|
||||
pub cwd: Url,
|
||||
|
|
|
|||
4
yazi-core/src/external/rg.rs
vendored
4
yazi-core/src/external/rg.rs
vendored
|
|
@ -2,9 +2,7 @@ use std::process::Stdio;
|
|||
|
||||
use anyhow::Result;
|
||||
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}};
|
||||
use yazi_shared::fs::Url;
|
||||
|
||||
use crate::files::File;
|
||||
use yazi_shared::{files::File, fs::Url};
|
||||
|
||||
pub struct RgOpt {
|
||||
pub cwd: Url,
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ use std::{collections::{BTreeMap, BTreeSet}, mem, ops::Deref, sync::atomic::Orde
|
|||
use anyhow::Result;
|
||||
use tokio::{fs, select, sync::mpsc::{self, UnboundedReceiver}};
|
||||
use yazi_config::{manager::SortBy, MANAGER};
|
||||
use yazi_shared::fs::Url;
|
||||
use yazi_shared::{files::{File, FILES_TICKET}, fs::Url};
|
||||
|
||||
use super::{File, FilesSorter, FILES_TICKET};
|
||||
use super::FilesSorter;
|
||||
|
||||
pub struct Files {
|
||||
items: Vec<File>,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
mod file;
|
||||
mod files;
|
||||
mod op;
|
||||
mod sorter;
|
||||
|
||||
pub use file::*;
|
||||
pub use files::*;
|
||||
pub use op::*;
|
||||
pub use sorter::*;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use std::{cmp::Ordering, collections::BTreeMap, mem};
|
||||
|
||||
use yazi_config::manager::SortBy;
|
||||
use yazi_shared::{fs::Url, natsort};
|
||||
|
||||
use super::File;
|
||||
use yazi_shared::{files::File, fs::Url, natsort};
|
||||
|
||||
#[derive(Clone, Copy, Default, PartialEq)]
|
||||
pub struct FilesSorter {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::help::Help;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::help::Help;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use yazi_config::popup::{Offset, Origin, Position};
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{help::Help, input::Input};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::Input;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::{CharKind, Exec};
|
||||
use yazi_shared::{event::Exec, CharKind};
|
||||
|
||||
use crate::input::Input;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::{Exec, InputError};
|
||||
use yazi_shared::{event::Exec, InputError};
|
||||
|
||||
use crate::{completion::Completion, input::Input};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use std::path::MAIN_SEPARATOR;
|
||||
|
||||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{emit, input::Input};
|
||||
use crate::input::Input;
|
||||
|
||||
pub struct Opt<'a> {
|
||||
word: &'a str,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{op::InputOp, Input};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{completion::Completion, input::{op::InputOp, Input, InputMode}};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::{CharKind, Exec};
|
||||
use yazi_shared::{event::Exec, CharKind};
|
||||
|
||||
use crate::input::{op::InputOp, Input};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{op::InputOp, Input, InputMode};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::ops::RangeBounds;
|
||||
|
||||
use yazi_shared::{CharKind, Exec};
|
||||
use yazi_shared::{event::Exec, CharKind};
|
||||
|
||||
use crate::input::Input;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use unicode_width::UnicodeWidthStr;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{op::InputOp, snap::InputSnap, Input};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{external, input::{op::InputOp, Input}};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::Input;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use anyhow::anyhow;
|
||||
use tokio::sync::mpsc;
|
||||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::{Exec, InputError, Layer};
|
||||
use yazi_shared::{emit, event::Exec, InputError, Layer};
|
||||
|
||||
use crate::{emit, input::Input};
|
||||
use crate::input::Input;
|
||||
|
||||
pub struct Opt {
|
||||
cfg: InputCfg,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use yazi_config::keymap::Key;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{Input, InputMode};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{Input, InputMode};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{op::InputOp, Input, InputMode};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::input::{op::InputOp, Input};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
mod blocker;
|
||||
pub mod completion;
|
||||
mod context;
|
||||
mod event;
|
||||
pub mod external;
|
||||
pub mod files;
|
||||
pub mod help;
|
||||
|
|
@ -25,7 +24,6 @@ pub mod which;
|
|||
|
||||
pub use blocker::*;
|
||||
pub use context::*;
|
||||
pub use event::*;
|
||||
pub use highlighter::*;
|
||||
pub use step::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tasks::Tasks};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ use std::path::{PathBuf, MAIN_SEPARATOR};
|
|||
|
||||
use tokio::fs;
|
||||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::{fs::Url, Exec};
|
||||
use yazi_shared::{emit, event::Exec, files::{File, FilesOp}, fs::Url};
|
||||
|
||||
use crate::{emit, files::{File, FilesOp}, input::Input, manager::Manager};
|
||||
use crate::{input::Input, manager::Manager};
|
||||
|
||||
pub struct Opt {
|
||||
force: bool,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
use std::collections::BTreeSet;
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::{fs::Url, Layer};
|
||||
use yazi_shared::{emit, event::Exec, fs::Url, Layer};
|
||||
|
||||
use crate::{emit, manager::Manager};
|
||||
use crate::manager::Manager;
|
||||
|
||||
pub struct Opt {
|
||||
url: Option<Url>,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tasks::Tasks};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::ffi::OsString;
|
||||
|
||||
use yazi_config::{popup::SelectCfg, OPEN};
|
||||
use yazi_shared::{Exec, MIME_DIR};
|
||||
use yazi_shared::{event::Exec, MIME_DIR};
|
||||
|
||||
use crate::{external, manager::Manager, select::Select, tasks::Tasks};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tasks::Tasks};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use yazi_config::MANAGER;
|
||||
use yazi_shared::{fs::Url, Exec, Layer, MIME_DIR};
|
||||
use yazi_shared::{emit, event::Exec, fs::Url, Layer, MIME_DIR};
|
||||
|
||||
use crate::{emit, manager::Manager};
|
||||
use crate::manager::Manager;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Opt {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::{emit, event::Exec};
|
||||
|
||||
use crate::{emit, input::Input, manager::Manager, tasks::Tasks};
|
||||
use crate::{input::Input, manager::Manager, tasks::Tasks};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Opt {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
use std::env;
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::Layer;
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{emit, manager::Manager};
|
||||
use crate::manager::Manager;
|
||||
|
||||
pub struct Opt;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tasks::Tasks};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ use std::{collections::BTreeMap, ffi::OsStr, io::{stdout, BufWriter, Write}, pat
|
|||
use anyhow::{anyhow, bail, Result};
|
||||
use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}};
|
||||
use yazi_config::{popup::InputCfg, OPEN, PREVIEW};
|
||||
use yazi_shared::{fs::{max_common_root, Url}, term::Term, Defer, Exec};
|
||||
use yazi_shared::{emit, event::Exec, files::{File, FilesOp}, fs::{max_common_root, Url}, term::Term, Defer};
|
||||
|
||||
use crate::{emit, external::{self, ShellOpt}, files::{File, FilesOp}, input::Input, manager::Manager, Ctx, BLOCKER};
|
||||
use crate::{external::{self, ShellOpt}, input::Input, manager::Manager, Ctx, BLOCKER};
|
||||
|
||||
pub struct Opt {
|
||||
force: bool,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, Ctx};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::manager::Tabs;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::fs::Url;
|
||||
use yazi_shared::{event::Exec, fs::Url};
|
||||
|
||||
use crate::{manager::Tabs, tab::Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::manager::Tabs;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::manager::Tabs;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::manager::Manager;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
|
||||
use yazi_shared::fs::Url;
|
||||
use yazi_shared::{files::{File, FilesOp}, fs::Url};
|
||||
|
||||
use super::{Tabs, Watcher};
|
||||
use crate::{files::{File, FilesOp}, tab::{Folder, Tab}, tasks::Tasks};
|
||||
use crate::{tab::{Folder, Tab}, tasks::Tasks};
|
||||
|
||||
pub struct Manager {
|
||||
pub tabs: Tabs,
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use notify::{event::{MetadataKind, ModifyKind}, EventKind, RecommendedWatcher, R
|
|||
use parking_lot::RwLock;
|
||||
use tokio::{fs, pin, sync::mpsc::{self, UnboundedReceiver}};
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_shared::fs::Url;
|
||||
use yazi_shared::{emit, files::{File, FilesOp}, fs::Url};
|
||||
|
||||
use crate::{emit, external, files::{File, Files, FilesOp}};
|
||||
use crate::{external, files::Files};
|
||||
|
||||
pub struct Watcher {
|
||||
watcher: RecommendedWatcher,
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ use tokio::{pin, task::JoinHandle};
|
|||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_adaptor::ADAPTOR;
|
||||
use yazi_config::MANAGER;
|
||||
use yazi_shared::{fs::{Cha, Url}, MimeKind, PeekError};
|
||||
use yazi_shared::{emit, event::{PreviewData, PreviewLock}, files::FilesOp, fs::{Cha, Url}, MimeKind, PeekError};
|
||||
|
||||
use super::Provider;
|
||||
use crate::{emit, files::{Files, FilesOp}, manager::Manager, Highlighter};
|
||||
use crate::{files::Files, manager::Manager, Highlighter};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Preview {
|
||||
|
|
@ -17,20 +17,6 @@ pub struct Preview {
|
|||
handle: Option<JoinHandle<()>>,
|
||||
}
|
||||
|
||||
pub struct PreviewLock {
|
||||
pub url: Url,
|
||||
pub cha: Option<Cha>,
|
||||
pub skip: usize,
|
||||
pub data: PreviewData,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum PreviewData {
|
||||
Folder,
|
||||
Text(String),
|
||||
Image,
|
||||
}
|
||||
|
||||
impl Preview {
|
||||
pub fn go(&mut self, url: &Url, cha: Cha, mime: &str) {
|
||||
if self.content_unchanged(url, &cha) {
|
||||
|
|
@ -152,11 +138,3 @@ impl Preview {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PreviewLock {
|
||||
#[inline]
|
||||
pub fn is_image(&self) -> bool { matches!(self.data, PreviewData::Image) }
|
||||
|
||||
#[inline]
|
||||
pub fn is_folder(&self) -> bool { matches!(self.data, PreviewData::Folder) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,8 @@ use std::path::Path;
|
|||
use tokio::fs;
|
||||
use yazi_adaptor::ADAPTOR;
|
||||
use yazi_config::{MANAGER, PREVIEW};
|
||||
use yazi_shared::{MimeKind, PeekError};
|
||||
use yazi_shared::{event::PreviewData, MimeKind, PeekError};
|
||||
|
||||
use super::PreviewData;
|
||||
use crate::{external, Highlighter};
|
||||
|
||||
pub(super) struct Provider;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::select::Select;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::anyhow;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::select::Select;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use anyhow::{anyhow, Result};
|
||||
use tokio::sync::oneshot;
|
||||
use yazi_config::popup::SelectCfg;
|
||||
use yazi_shared::{term::Term, Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, term::Term, Layer};
|
||||
|
||||
use crate::{emit, select::Select};
|
||||
use crate::select::Select;
|
||||
|
||||
pub struct Opt {
|
||||
cfg: SelectCfg,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tab::Tab, Step};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tab::Tab;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ use std::{mem, time::Duration};
|
|||
use tokio::{fs, pin};
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::{fs::{expand_path, Url}, Debounce, Exec, InputError, Layer};
|
||||
use yazi_shared::{emit, event::Exec, fs::{expand_path, Url}, Debounce, InputError, Layer};
|
||||
|
||||
use crate::{completion::Completion, emit, input::Input, manager::Manager, tab::Tab};
|
||||
use crate::{completion::Completion, input::Input, manager::Manager, tab::Tab};
|
||||
|
||||
pub struct Opt {
|
||||
target: Url,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::ffi::{OsStr, OsString};
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{external, tab::Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::mem;
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tab::Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use bitflags::bitflags;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tab::{Mode, Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ use std::time::Duration;
|
|||
use tokio::pin;
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::{Debounce, Exec, InputError, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Debounce, InputError, Layer};
|
||||
|
||||
use crate::{emit, input::Input, tab::{Finder, FinderCase, Tab}};
|
||||
use crate::{input::Input, tab::{Finder, FinderCase, Tab}};
|
||||
|
||||
pub struct Opt<'a> {
|
||||
query: Option<&'a str>,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tab::Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::{fs::ends_with_slash, Defer, Exec};
|
||||
use yazi_shared::{event::Exec, fs::ends_with_slash, Defer};
|
||||
|
||||
use crate::{external::{self, FzfOpt, ZoxideOpt}, tab::Tab, Ctx, BLOCKER};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::mem;
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{manager::Manager, tab::Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tab::Tab;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::{fs::{expand_path, Url}, Layer};
|
||||
use yazi_shared::{emit, event::Exec, files::{File, FilesOp}, fs::{expand_path, Url}, Layer};
|
||||
|
||||
use crate::{emit, files::{File, FilesOp}, manager::Manager, tab::Tab};
|
||||
use crate::{manager::Manager, tab::Tab};
|
||||
|
||||
pub struct Opt {
|
||||
target: Url,
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ use anyhow::bail;
|
|||
use tokio::pin;
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::{emit, event::Exec, files::FilesOp};
|
||||
|
||||
use crate::{emit, external, files::FilesOp, input::Input, manager::Manager, tab::Tab};
|
||||
use crate::{external, input::Input, manager::Manager, tab::Tab};
|
||||
|
||||
pub struct Opt {
|
||||
pub type_: OptType,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tab::Tab;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use yazi_config::{open::Opener, popup::InputCfg};
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::{input::Input, tab::Tab, tasks::Tasks};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::str::FromStr;
|
||||
|
||||
use yazi_config::manager::SortBy;
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tab::Tab;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::collections::BTreeSet;
|
||||
|
||||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tab::{Mode, Tab};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use ratatui::layout::Rect;
|
||||
use yazi_config::MANAGER;
|
||||
use yazi_shared::fs::Url;
|
||||
use yazi_shared::{emit, files::{File, FilesOp}, fs::Url};
|
||||
|
||||
use crate::{emit, files::{File, Files, FilesOp}, Step};
|
||||
use crate::{files::Files, Step};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Folder {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ use std::{borrow::Cow, collections::BTreeMap};
|
|||
|
||||
use anyhow::Result;
|
||||
use tokio::task::JoinHandle;
|
||||
use yazi_shared::fs::Url;
|
||||
use yazi_shared::{event::PreviewLock, files::File, fs::Url};
|
||||
|
||||
use super::{Backstack, Config, Finder, Folder, Mode};
|
||||
use crate::{files::File, preview::{Preview, PreviewLock}};
|
||||
use crate::preview::Preview;
|
||||
|
||||
pub struct Tab {
|
||||
pub mode: Mode,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tasks::Tasks;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tasks::Tasks;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::io::{stdout, Write};
|
|||
|
||||
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
|
||||
use tokio::{io::{stdin, AsyncReadExt}, select, sync::mpsc, time};
|
||||
use yazi_shared::{term::Term, Defer, Exec};
|
||||
use yazi_shared::{event::Exec, term::Term, Defer};
|
||||
|
||||
use crate::{tasks::Tasks, Ctx, BLOCKER};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ use std::ffi::OsString;
|
|||
|
||||
use anyhow::anyhow;
|
||||
use yazi_config::{open::Opener, BOOT};
|
||||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{emit, tasks::Tasks};
|
||||
use crate::tasks::Tasks;
|
||||
|
||||
pub struct Opt {
|
||||
targets: Vec<(OsString, String)>,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_shared::Exec;
|
||||
use yazi_shared::event::Exec;
|
||||
|
||||
use crate::tasks::Tasks;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::anyhow;
|
||||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
use crate::{emit, tasks::{Tasks, TasksProgress}};
|
||||
use crate::tasks::{Tasks, TasksProgress};
|
||||
|
||||
pub struct Opt {
|
||||
progress: TasksProgress,
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ use std::{collections::{BTreeMap, HashMap, HashSet}, ffi::OsStr, path::Path, syn
|
|||
use serde::Serialize;
|
||||
use tracing::debug;
|
||||
use yazi_config::{manager::SortBy, open::Opener, popup::InputCfg, OPEN};
|
||||
use yazi_shared::{fs::Url, term::Term, MimeKind};
|
||||
use yazi_shared::{files::File, fs::Url, term::Term, MimeKind};
|
||||
|
||||
use super::{running::Running, task::TaskSummary, Scheduler, TASKS_PADDING, TASKS_PERCENT};
|
||||
use crate::{files::{File, Files}, input::Input};
|
||||
use crate::{files::Files, input::Input};
|
||||
|
||||
pub struct Tasks {
|
||||
pub(super) scheduler: Arc<Scheduler>,
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use parking_lot::Mutex;
|
|||
use tokio::{fs, sync::mpsc};
|
||||
use yazi_adaptor::Image;
|
||||
use yazi_config::PREVIEW;
|
||||
use yazi_shared::{fs::{calculate_size, Url}, Throttle};
|
||||
use yazi_shared::{emit, files::FilesOp, fs::{calculate_size, Url}, Throttle};
|
||||
|
||||
use crate::{emit, external, files::FilesOp, tasks::TaskOp};
|
||||
use crate::{external, tasks::TaskOp};
|
||||
|
||||
pub(crate) struct Precache {
|
||||
tx: async_channel::Sender<PrecacheOp>,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use std::mem;
|
||||
|
||||
use yazi_config::{keymap::{Control, Key}, KEYMAP};
|
||||
use yazi_shared::Layer;
|
||||
|
||||
use crate::emit;
|
||||
use yazi_shared::{emit, Layer};
|
||||
|
||||
pub struct Which {
|
||||
layer: Layer,
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use anyhow::{Ok, Result};
|
|||
use crossterm::event::KeyEvent;
|
||||
use ratatui::{backend::Backend, prelude::Rect};
|
||||
use yazi_config::{keymap::Key, BOOT};
|
||||
use yazi_core::{emit, files::FilesOp, input::InputMode, preview::COLLISION, Ctx, Event};
|
||||
use yazi_shared::{term::Term, Exec, Layer};
|
||||
use yazi_core::{input::InputMode, preview::COLLISION, Ctx};
|
||||
use yazi_shared::{emit, event::{Event, Exec}, files::FilesOp, term::Term, Layer};
|
||||
|
||||
use crate::{Executor, Logs, Panic, Root, Signals};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use tokio::sync::oneshot;
|
||||
use yazi_core::{emit, manager::Manager};
|
||||
use yazi_shared::{term::Term, Exec};
|
||||
use yazi_core::manager::Manager;
|
||||
use yazi_shared::{emit, event::Exec, term::Term};
|
||||
|
||||
use crate::app::App;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use yazi_config::{keymap::{Control, Key}, KEYMAP};
|
||||
use yazi_core::input::InputMode;
|
||||
use yazi_shared::{Exec, Layer};
|
||||
use yazi_shared::{event::Exec, Layer};
|
||||
|
||||
use crate::app::App;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use anyhow::Result;
|
|||
use crossterm::event::{Event as CrosstermEvent, EventStream, KeyEvent, KeyEventKind};
|
||||
use futures::StreamExt;
|
||||
use tokio::{select, sync::{mpsc::{self, UnboundedReceiver, UnboundedSender}, oneshot}, task::JoinHandle};
|
||||
use yazi_core::Event;
|
||||
use yazi_shared::event::Event;
|
||||
|
||||
pub(super) struct Signals {
|
||||
tx: UnboundedSender<Event>,
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ impl<'a, 'b> Active<'a, 'b> {
|
|||
fn file(
|
||||
&self,
|
||||
idx: usize,
|
||||
inner: &'a yazi_core::files::File,
|
||||
inner: &'a yazi_shared::files::File,
|
||||
folder: &'a yazi_core::tab::Folder,
|
||||
) -> mlua::Result<AnyUserData<'a>> {
|
||||
let ud = self.scope.create_any_userdata_ref(inner)?;
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ use yazi_config::THEME;
|
|||
use super::{Range, Url};
|
||||
use crate::{layout::Style, LUA};
|
||||
|
||||
pub struct File(yazi_core::files::File);
|
||||
pub struct File(yazi_shared::files::File);
|
||||
|
||||
impl From<&yazi_core::files::File> for File {
|
||||
fn from(value: &yazi_core::files::File) -> Self { Self(value.clone()) }
|
||||
impl From<&yazi_shared::files::File> for File {
|
||||
fn from(value: &yazi_shared::files::File) -> Self { Self(value.clone()) }
|
||||
}
|
||||
|
||||
impl UserData for File {
|
||||
|
|
@ -47,7 +47,7 @@ impl Files {
|
|||
});
|
||||
})?;
|
||||
|
||||
LUA.register_userdata_type::<yazi_core::files::File>(|reg| {
|
||||
LUA.register_userdata_type::<yazi_shared::files::File>(|reg| {
|
||||
reg.add_field_method_get("url", |_, me| Ok(Url::from(&me.url)));
|
||||
reg.add_field_method_get("link_to", |_, me| Ok(me.link_to().map(Url::from)));
|
||||
reg.add_field_method_get("is_link", |_, me| Ok(me.is_link()));
|
||||
|
|
@ -87,7 +87,7 @@ impl Files {
|
|||
Ok(me.url.file_name().map(|n| n.to_string_lossy().to_string()))
|
||||
});
|
||||
reg.add_function("size", |_, me: AnyUserData| {
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
if !file.is_dir() {
|
||||
return Ok(Some(file.len));
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ impl Files {
|
|||
});
|
||||
reg.add_function("mime", |_, me: AnyUserData| {
|
||||
let manager = me.named_user_value::<UserDataRef<yazi_core::manager::Manager>>("manager")?;
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
Ok(manager.mimetype.get(&file.url).cloned())
|
||||
});
|
||||
reg.add_function("prefix", |_, me: AnyUserData| {
|
||||
|
|
@ -106,7 +106,7 @@ impl Files {
|
|||
return Ok(None);
|
||||
}
|
||||
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
let mut p = file.url.strip_prefix(&folder.cwd).unwrap_or(&file.url).components();
|
||||
p.next_back();
|
||||
Ok(Some(p.as_path().to_string_lossy().to_string()))
|
||||
|
|
@ -122,7 +122,7 @@ impl Files {
|
|||
});
|
||||
reg.add_function("style", |_, me: AnyUserData| {
|
||||
let manager = me.named_user_value::<UserDataRef<yazi_core::manager::Manager>>("manager")?;
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
let mime = manager.mimetype.get(&file.url);
|
||||
Ok(
|
||||
THEME
|
||||
|
|
@ -134,12 +134,12 @@ impl Files {
|
|||
});
|
||||
reg.add_function("is_hovered", |_, me: AnyUserData| {
|
||||
let folder = me.named_user_value::<UserDataRef<yazi_core::tab::Folder>>("folder")?;
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
Ok(matches!(folder.hovered(), Some(f) if f.url == file.url))
|
||||
});
|
||||
reg.add_function("is_yanked", |_, me: AnyUserData| {
|
||||
let manager = me.named_user_value::<UserDataRef<yazi_core::manager::Manager>>("manager")?;
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
Ok(if !manager.yanked.1.contains(&file.url) {
|
||||
0u8
|
||||
} else if manager.yanked.0 {
|
||||
|
|
@ -151,7 +151,7 @@ impl Files {
|
|||
reg.add_function("is_selected", |_, me: AnyUserData| {
|
||||
let manager = me.named_user_value::<UserDataRef<yazi_core::manager::Manager>>("manager")?;
|
||||
let folder = me.named_user_value::<UserDataRef<yazi_core::tab::Folder>>("folder")?;
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
|
||||
let selected = folder.files.is_selected(&file.url);
|
||||
Ok(if !manager.active().mode.is_visual() {
|
||||
|
|
@ -167,7 +167,7 @@ impl Files {
|
|||
return Ok(None);
|
||||
};
|
||||
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
if let Some(idx) = finder.matched_idx(&file.url) {
|
||||
return Some(
|
||||
lua.create_sequence_from([idx.into_lua(lua)?, finder.matched().len().into_lua(lua)?]),
|
||||
|
|
@ -182,7 +182,7 @@ impl Files {
|
|||
return Ok(None);
|
||||
};
|
||||
|
||||
let file = me.borrow::<yazi_core::files::File>()?;
|
||||
let file = me.borrow::<yazi_shared::files::File>()?;
|
||||
let Some(h) = file.name().and_then(|n| finder.highlighted(n)) else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use ansi_to_tui::IntoText;
|
||||
use ratatui::{buffer::Buffer, layout::Rect, widgets::{Paragraph, Widget}};
|
||||
use yazi_core::{preview::PreviewData, Ctx};
|
||||
use yazi_core::Ctx;
|
||||
use yazi_shared::event::PreviewData;
|
||||
|
||||
use super::Folder;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ use std::collections::BTreeMap;
|
|||
|
||||
use crossterm::event::KeyEvent;
|
||||
use tokio::sync::{mpsc::UnboundedSender, oneshot};
|
||||
use yazi_shared::{fs::Url, term::Term, Exec, Layer, RoCell};
|
||||
|
||||
use super::files::FilesOp;
|
||||
use crate::preview::PreviewLock;
|
||||
use super::Exec;
|
||||
use crate::{files::FilesOp, fs::{Cha, Url}, term::Term, Layer, RoCell};
|
||||
|
||||
static TX: RoCell<UnboundedSender<Event>> = RoCell::new();
|
||||
|
||||
|
|
@ -40,39 +39,62 @@ impl Event {
|
|||
#[macro_export]
|
||||
macro_rules! emit {
|
||||
(Quit($no_cwd_file:expr)) => {
|
||||
$crate::Event::Quit($no_cwd_file).emit();
|
||||
$crate::event::Event::Quit($no_cwd_file).emit();
|
||||
};
|
||||
(Key($key:expr)) => {
|
||||
$crate::Event::Key($key).emit();
|
||||
$crate::event::Event::Key($key).emit();
|
||||
};
|
||||
(Render) => {
|
||||
$crate::Event::Render(format!("{}:{}", file!(), line!())).emit();
|
||||
$crate::event::Event::Render(format!("{}:{}", file!(), line!())).emit();
|
||||
};
|
||||
(Resize($cols:expr, $rows:expr)) => {
|
||||
$crate::Event::Resize($cols, $rows).emit();
|
||||
$crate::event::Event::Resize($cols, $rows).emit();
|
||||
};
|
||||
(Call($exec:expr, $layer:expr)) => {
|
||||
$crate::Event::Call($exec, $layer).emit();
|
||||
$crate::event::Event::Call($exec, $layer).emit();
|
||||
};
|
||||
|
||||
(Files($op:expr)) => {
|
||||
$crate::Event::Files($op).emit();
|
||||
$crate::event::Event::Files($op).emit();
|
||||
};
|
||||
(Pages($page:expr)) => {
|
||||
$crate::Event::Pages($page).emit();
|
||||
$crate::event::Event::Pages($page).emit();
|
||||
};
|
||||
(Mimetype($mimes:expr)) => {
|
||||
$crate::Event::Mimetype($mimes).emit();
|
||||
$crate::event::Event::Mimetype($mimes).emit();
|
||||
};
|
||||
(Preview($lock:expr)) => {
|
||||
$crate::Event::Preview($lock).emit();
|
||||
$crate::event::Event::Preview($lock).emit();
|
||||
};
|
||||
|
||||
(Open($targets:expr, $opener:expr)) => {
|
||||
$crate::Event::Open($targets, $opener).emit();
|
||||
$crate::event::Event::Open($targets, $opener).emit();
|
||||
};
|
||||
|
||||
($event:ident) => {
|
||||
$crate::Event::$event.emit();
|
||||
$crate::event::Event::$event.emit();
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: remove this
|
||||
pub struct PreviewLock {
|
||||
pub url: Url,
|
||||
pub cha: Option<Cha>,
|
||||
pub skip: usize,
|
||||
pub data: PreviewData,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum PreviewData {
|
||||
Folder,
|
||||
Text(String),
|
||||
Image,
|
||||
}
|
||||
|
||||
impl PreviewLock {
|
||||
#[inline]
|
||||
pub fn is_image(&self) -> bool { matches!(self.data, PreviewData::Image) }
|
||||
|
||||
#[inline]
|
||||
pub fn is_folder(&self) -> bool { matches!(self.data, PreviewData::Folder) }
|
||||
}
|
||||
7
yazi-shared/src/event/mod.rs
Normal file
7
yazi-shared/src/event/mod.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![allow(clippy::module_inception)]
|
||||
|
||||
mod event;
|
||||
mod exec;
|
||||
|
||||
pub use event::*;
|
||||
pub use exec::*;
|
||||
|
|
@ -2,7 +2,8 @@ use std::{borrow::Cow, collections::BTreeMap, ffi::OsStr, fs::Metadata, ops::Der
|
|||
|
||||
use anyhow::Result;
|
||||
use tokio::fs;
|
||||
use yazi_shared::fs::{Cha, ChaKind, Url};
|
||||
|
||||
use crate::fs::{Cha, ChaKind, Url};
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct File {
|
||||
5
yazi-shared/src/files/mod.rs
Normal file
5
yazi-shared/src/files/mod.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
mod file;
|
||||
mod op;
|
||||
|
||||
pub use file::*;
|
||||
pub use op::*;
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
use std::{collections::{BTreeMap, BTreeSet}, sync::atomic::{AtomicU64, Ordering}};
|
||||
|
||||
use yazi_shared::fs::Url;
|
||||
|
||||
use super::File;
|
||||
use crate::emit;
|
||||
use crate::{emit, fs::Url};
|
||||
|
||||
pub(super) static FILES_TICKET: AtomicU64 = AtomicU64::new(0);
|
||||
pub static FILES_TICKET: AtomicU64 = AtomicU64::new(0);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FilesOp {
|
||||
|
|
@ -5,7 +5,8 @@ mod debounce;
|
|||
mod defer;
|
||||
mod env;
|
||||
mod errors;
|
||||
mod event;
|
||||
pub mod event;
|
||||
pub mod files;
|
||||
pub mod fs;
|
||||
mod layer;
|
||||
mod mime;
|
||||
|
|
@ -20,7 +21,6 @@ pub use debounce::*;
|
|||
pub use defer::*;
|
||||
pub use env::*;
|
||||
pub use errors::*;
|
||||
pub use event::*;
|
||||
pub use layer::*;
|
||||
pub use mime::*;
|
||||
pub use natsort::*;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue