refactor: simplify module exports (#1770)

This commit is contained in:
三咲雅 · Misaki Masa 2024-10-12 21:05:12 +08:00 committed by GitHub
parent da1b2365b9
commit 13e307eab2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
209 changed files with 553 additions and 1021 deletions

72
Cargo.lock generated
View file

@ -339,9 +339,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.28"
version = "1.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1"
checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945"
dependencies = [
"jobserver",
"libc",
@ -378,9 +378,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.19"
version = "4.5.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615"
checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8"
dependencies = [
"clap_builder",
"clap_derive",
@ -388,9 +388,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.19"
version = "4.5.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b"
checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54"
dependencies = [
"anstream",
"anstyle",
@ -400,9 +400,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.5.32"
version = "4.5.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74a01f4f9ee6c066d42a1c8dedf0dcddad16c72a8981a309d6398de3a75b0c39"
checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb"
dependencies = [
"clap",
]
@ -419,9 +419,9 @@ dependencies = [
[[package]]
name = "clap_complete_nushell"
version = "4.5.3"
version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fe32110e006bccf720f8c9af3fee1ba7db290c724eab61544e1d3295be3a40e"
checksum = "315902e790cc6e5ddd20cbd313c1d0d49db77f191e149f96397230fb82a17677"
dependencies = [
"clap",
"clap_complete",
@ -640,18 +640,18 @@ dependencies = [
[[package]]
name = "derive_builder"
version = "0.20.1"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b"
checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947"
dependencies = [
"derive_builder_macro",
]
[[package]]
name = "derive_builder_core"
version = "0.20.1"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38"
checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8"
dependencies = [
"darling",
"proc-macro2",
@ -661,9 +661,9 @@ dependencies = [
[[package]]
name = "derive_builder_macro"
version = "0.20.1"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc"
checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
dependencies = [
"derive_builder_core",
"syn 2.0.79",
@ -1228,9 +1228,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.70"
version = "0.3.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9"
dependencies = [
"wasm-bindgen",
]
@ -1355,9 +1355,9 @@ dependencies = [
[[package]]
name = "luajit-src"
version = "210.5.10+f725e44"
version = "210.5.11+97813fb"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18a0fa0df28e21f785c48d9c0f0be355cf40658badb667284207dbb4d1e574a9"
checksum = "3015551c284515db7c30c559fc1080f9cb9ee990d1f6fca315451a107c7540bb"
dependencies = [
"cc",
"which",
@ -2862,9 +2862,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.93"
version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e"
dependencies = [
"cfg-if",
"once_cell",
@ -2873,9 +2873,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.93"
version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358"
dependencies = [
"bumpalo",
"log",
@ -2888,9 +2888,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.93"
version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@ -2898,9 +2898,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.93"
version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
dependencies = [
"proc-macro2",
"quote",
@ -2911,9 +2911,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.93"
version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d"
[[package]]
name = "weezl"
@ -3208,6 +3208,7 @@ dependencies = [
"tokio",
"tracing",
"yazi-config",
"yazi-macro",
"yazi-shared",
]
@ -3224,6 +3225,7 @@ dependencies = [
"vergen-gitcl",
"yazi-adapter",
"yazi-config",
"yazi-macro",
"yazi-shared",
]
@ -3244,6 +3246,7 @@ dependencies = [
"vergen-gitcl",
"yazi-boot",
"yazi-dds",
"yazi-macro",
"yazi-shared",
]
@ -3270,6 +3273,7 @@ dependencies = [
"serde",
"toml",
"validator",
"yazi-macro",
"yazi-shared",
]
@ -3299,6 +3303,7 @@ dependencies = [
"yazi-config",
"yazi-dds",
"yazi-fs",
"yazi-macro",
"yazi-plugin",
"yazi-proxy",
"yazi-scheduler",
@ -3321,6 +3326,7 @@ dependencies = [
"uzers",
"vergen-gitcl",
"yazi-boot",
"yazi-macro",
"yazi-shared",
]
@ -3352,6 +3358,7 @@ dependencies = [
"yazi-core",
"yazi-dds",
"yazi-fs",
"yazi-macro",
"yazi-plugin",
"yazi-proxy",
"yazi-shared",
@ -3363,10 +3370,10 @@ version = "0.3.3"
dependencies = [
"anyhow",
"futures",
"ratatui",
"regex",
"tokio",
"yazi-config",
"yazi-macro",
"yazi-proxy",
"yazi-shared",
]
@ -3402,6 +3409,7 @@ dependencies = [
"yazi-boot",
"yazi-config",
"yazi-dds",
"yazi-macro",
"yazi-prebuild",
"yazi-proxy",
"yazi-shared",
@ -3422,6 +3430,7 @@ dependencies = [
"shell-words",
"tokio",
"yazi-config",
"yazi-macro",
"yazi-shared",
]
@ -3440,6 +3449,7 @@ dependencies = [
"trash",
"yazi-config",
"yazi-dds",
"yazi-macro",
"yazi-plugin",
"yazi-proxy",
"yazi-shared",

View file

@ -15,7 +15,7 @@ anyhow = "1.0.89"
arc-swap = "1.7.1"
base64 = "0.22.1"
bitflags = "2.6.0"
clap = { version = "4.5.19", features = [ "derive" ] }
clap = { version = "4.5.20", features = [ "derive" ] }
crossterm = { version = "0.28.1", features = [ "event-stream" ] }
dirs = "5.0.1"
futures = "0.3.31"

View file

@ -1 +1 @@
{"language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp"," Überzug"," Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","imagesize","Upserting","prio","Ghostty","Catmull","Lanczos","cmds","unyank","scrolloff","headsup","unsub","uzers","scopeguard","SPDLOG","globset","filetime","magick","magick","prefetcher","Prework","prefetchers","PREWORKERS","conds","translit","rxvt","Urxvt","realpath","realname","REPARSE","hardlink","hardlinking","nlink","nlink","linemodes","SIGSTOP","sevenzip","rsplitn","replacen","DECSET","DECRQM","repeek","cwds","tcsi","Hyprland","Wayfire","SWAYSOCK","btime","nsec","codegen"],"version":"0.2","flagWords":[]}
{"words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp"," Überzug"," Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","imagesize","Upserting","prio","Ghostty","Catmull","Lanczos","cmds","unyank","scrolloff","headsup","unsub","uzers","scopeguard","SPDLOG","globset","filetime","magick","magick","prefetcher","Prework","prefetchers","PREWORKERS","conds","translit","rxvt","Urxvt","realpath","realname","REPARSE","hardlink","hardlinking","nlink","nlink","linemodes","SIGSTOP","sevenzip","rsplitn","replacen","DECSET","DECRQM","repeek","cwds","tcsi","Hyprland","Wayfire","SWAYSOCK","btime","nsec","codegen","gethostname"],"flagWords":[],"version":"0.2","language":"en"}

View file

@ -10,6 +10,7 @@ repository = "https://github.com/sxyazi/yazi"
[dependencies]
yazi-config = { path = "../yazi-config", version = "0.3.3" }
yazi-macro = { path = "../yazi-macro", version = "0.3.3" }
yazi-shared = { path = "../yazi-shared", version = "0.3.3" }
# External dependencies

View file

@ -1,31 +1,10 @@
#![allow(clippy::unit_arg)]
mod adapter;
mod chafa;
mod dimension;
mod emulator;
mod iip;
mod image;
mod kgp;
mod kgp_old;
mod mux;
mod sixel;
mod ueberzug;
yazi_macro::mod_flat!(
adapter, chafa, dimension, emulator, iip, image, kgp, kgp_old, mux, sixel, ueberzug
);
pub use adapter::*;
use chafa::*;
pub use dimension::*;
pub use emulator::*;
use iip::*;
use kgp::*;
use kgp_old::*;
pub use mux::*;
use sixel::*;
use ueberzug::*;
use yazi_shared::{RoCell, env_exists, in_wsl};
pub use crate::image::*;
pub static ADAPTOR: RoCell<Adapter> = RoCell::new();
// Tmux support

View file

@ -9,18 +9,19 @@ homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"
[dependencies]
regex = { workspace = true }
yazi-adapter = { path = "../yazi-adapter", version = "0.3.3" }
yazi-config = { path = "../yazi-config", version = "0.3.3" }
yazi-macro = { path = "../yazi-macro", version = "0.3.3" }
yazi-shared = { path = "../yazi-shared", version = "0.3.3" }
# External dependencies
clap = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
[build-dependencies]
clap = { workspace = true }
clap_complete = "4.5.32"
clap_complete = "4.5.33"
clap_complete_fig = "4.5.2"
clap_complete_nushell = "4.5.3"
clap_complete_nushell = "4.5.4"
vergen-gitcl = { version = "1.0.1", features = [ "build" ] }

View file

@ -1,8 +1,3 @@
#![allow(clippy::module_inception)]
mod actions;
mod clear_cache;
mod debug;
mod version;
pub(super) use actions::*;
yazi_macro::mod_flat!(actions, clear_cache, debug, version);

View file

@ -1,13 +1,10 @@
yazi_macro::mod_pub!(actions);
yazi_macro::mod_flat!(args, boot);
use clap::Parser;
use yazi_shared::RoCell;
mod actions;
mod args;
mod boot;
pub use args::*;
pub use boot::*;
pub static ARGS: RoCell<Args> = RoCell::new();
pub static BOOT: RoCell<Boot> = RoCell::new();

View file

@ -11,6 +11,7 @@ repository = "https://github.com/sxyazi/yazi"
[dependencies]
yazi-boot = { path = "../yazi-boot", version = "0.3.3" }
yazi-dds = { path = "../yazi-dds", version = "0.3.3" }
yazi-macro = { path = "../yazi-macro", version = "0.3.3" }
yazi-shared = { path = "../yazi-shared", version = "0.3.3" }
# External dependencies
@ -26,9 +27,9 @@ toml_edit = "0.22.22"
# External build dependencies
anyhow = { workspace = true }
clap = { workspace = true }
clap_complete = "4.5.32"
clap_complete = "4.5.33"
clap_complete_fig = "4.5.2"
clap_complete_nushell = "4.5.3"
clap_complete_nushell = "4.5.4"
serde_json = { workspace = true }
vergen-gitcl = { version = "1.0.1", features = [ "build" ] }

View file

@ -1,7 +1,7 @@
mod args;
mod package;
yazi_macro::mod_pub!(package);
yazi_macro::mod_flat!(args);
use args::*;
use clap::Parser;
#[tokio::main]

View file

@ -1,16 +1,8 @@
#![allow(clippy::module_inception)]
mod add;
mod deploy;
mod git;
mod install;
mod package;
mod parser;
mod upgrade;
yazi_macro::mod_flat!(add, deploy, git, install, package, parser, upgrade);
use anyhow::Context;
use git::*;
pub(super) use package::*;
pub(super) fn init() -> anyhow::Result<()> {
let root = yazi_shared::Xdg::state_dir().join("packages");

View file

@ -9,6 +9,7 @@ homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"
[dependencies]
yazi-macro = { path = "../yazi-macro", version = "0.3.3" }
yazi-shared = { path = "../yazi-shared", version = "0.3.3" }
# External dependencies

View file

@ -1,11 +1 @@
mod chord;
mod cow;
mod deserializers;
mod key;
mod keymap;
pub use chord::*;
pub use cow::*;
use deserializers::*;
pub use key::*;
pub use keymap::*;
yazi_macro::mod_flat!(chord, cow, deserializers, key, keymap);

View file

@ -1,30 +1,13 @@
#![allow(clippy::module_inception)]
yazi_macro::mod_pub!(keymap, log, manager, open, plugin, popup, preview, tasks, theme, which);
yazi_macro::mod_flat!(layout, pattern, preset, priority);
use std::str::FromStr;
use yazi_shared::{RoCell, Xdg};
pub mod keymap;
mod layout;
mod log;
mod macros;
pub mod manager;
pub mod open;
mod pattern;
pub mod plugin;
pub mod popup;
mod preset;
pub mod preview;
mod priority;
mod tasks;
pub mod theme;
pub mod which;
pub use layout::*;
pub(crate) use pattern::*;
pub(crate) use preset::*;
pub use priority::*;
pub static LAYOUT: RoCell<arc_swap::ArcSwap<Layout>> = RoCell::new();
pub static KEYMAP: RoCell<keymap::Keymap> = RoCell::new();

View file

@ -1,3 +1 @@
mod log;
pub use log::*;
yazi_macro::mod_flat!(log);

View file

@ -1,9 +1 @@
mod manager;
mod mouse;
mod ratio;
mod sorting;
pub use manager::*;
pub use mouse::*;
pub use ratio::*;
pub use sorting::*;
yazi_macro::mod_flat!(manager, mouse, ratio, sorting);

View file

@ -1,7 +1 @@
mod open;
mod opener;
mod rule;
pub use open::*;
pub use opener::*;
use rule::*;
yazi_macro::mod_flat!(open, opener, rule);

View file

@ -1,11 +1,3 @@
mod fetcher;
mod plugin;
mod preloader;
mod previewer;
pub use fetcher::*;
pub use plugin::*;
pub use preloader::*;
pub use previewer::*;
yazi_macro::mod_flat!(fetcher, plugin, preloader, previewer);
pub const MAX_PREWORKERS: u8 = 32;

View file

@ -1,15 +1 @@
mod confirm;
mod input;
mod offset;
mod options;
mod origin;
mod position;
mod select;
pub use confirm::*;
pub use input::*;
pub use offset::*;
pub use options::*;
pub use origin::*;
pub use position::*;
pub use select::*;
yazi_macro::mod_flat!(confirm, input, offset, options, origin, position, select);

View file

@ -2,8 +2,9 @@ use std::{borrow::Cow, path::{Path, PathBuf}};
use anyhow::{Context, Result};
use toml::{Table, Value};
use yazi_macro::config_preset as preset;
use crate::{preset, theme::Flavor};
use crate::theme::Flavor;
pub(crate) struct Preset;

View file

@ -1,5 +1 @@
mod preview;
mod wrap;
pub use preview::*;
pub use wrap::*;
yazi_macro::mod_flat!(preview, wrap);

View file

@ -1,3 +1 @@
mod tasks;
pub use tasks::*;
yazi_macro::mod_flat!(tasks);

View file

@ -1,11 +1 @@
mod filetype;
mod flavor;
mod icons;
mod is;
mod theme;
pub use filetype::*;
pub use flavor::*;
pub use icons::*;
pub use is::*;
pub use theme::*;
yazi_macro::mod_flat!(filetype, flavor, icons, is, theme);

View file

@ -1,5 +1 @@
mod sorting;
mod which;
pub use sorting::*;
pub use which::*;
yazi_macro::mod_flat!(sorting, which);

View file

@ -15,6 +15,7 @@ yazi-codegen = { path = "../yazi-codegen", version = "0.3.3" }
yazi-config = { path = "../yazi-config", version = "0.3.3" }
yazi-dds = { path = "../yazi-dds", version = "0.3.3" }
yazi-fs = { path = "../yazi-fs", version = "0.3.3" }
yazi-macro = { path = "../yazi-macro", version = "0.3.3" }
yazi-plugin = { path = "../yazi-plugin", version = "0.3.3" }
yazi-proxy = { path = "../yazi-proxy", version = "0.3.3" }
yazi-scheduler = { path = "../yazi-scheduler", version = "0.3.3" }

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::completion::Completion;
pub struct Opt {
struct Opt {
step: isize,
}

View file

@ -1,9 +1,10 @@
use yazi_macro::render;
use yazi_proxy::InputProxy;
use yazi_shared::{event::Cmd, render};
use yazi_shared::event::Cmd;
use crate::completion::Completion;
pub struct Opt {
struct Opt {
submit: bool,
}

View file

@ -1,4 +1 @@
mod arrow;
mod close;
mod show;
mod trigger;
yazi_macro::mod_flat!(arrow, close, show, trigger);

View file

@ -1,12 +1,13 @@
use std::{mem, ops::ControlFlow};
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::completion::Completion;
const LIMIT: usize = 30;
pub struct Opt {
struct Opt {
cache: Vec<String>,
cache_name: String,
word: String,

View file

@ -1,7 +1,8 @@
use std::{borrow::Cow, mem, path::{MAIN_SEPARATOR, MAIN_SEPARATOR_STR}};
use tokio::fs;
use yazi_shared::{Layer, emit, event::{Cmd, Data}, render};
use yazi_macro::{emit, render};
use yazi_shared::{Layer, event::{Cmd, Data}};
use crate::completion::Completion;
@ -11,7 +12,7 @@ const SEPARATOR: [char; 2] = ['/', '\\'];
#[cfg(not(windows))]
const SEPARATOR: char = std::path::MAIN_SEPARATOR;
pub struct Opt {
struct Opt {
word: String,
ticket: usize,
}

View file

@ -1,4 +1,3 @@
mod commands;
mod completion;
yazi_macro::mod_pub!(commands);
pub use completion::*;
yazi_macro::mod_flat!(completion);

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::{confirm::Confirm, manager::Manager};
pub struct Opt {
struct Opt {
step: isize,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::confirm::Confirm;
pub struct Opt {
struct Opt {
submit: bool,
}

View file

@ -1,3 +1 @@
mod arrow;
mod close;
mod show;
yazi_macro::mod_flat!(arrow, close, show);

View file

@ -1,6 +1,7 @@
use tokio::sync::oneshot;
use yazi_config::popup::ConfirmCfg;
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::confirm::Confirm;

View file

@ -1,4 +1,3 @@
mod commands;
mod confirm;
yazi_macro::mod_pub!(commands);
pub use confirm::*;
yazi_macro::mod_flat!(confirm);

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::help::Help;
pub struct Opt {
struct Opt {
step: isize,
}

View file

@ -1,4 +1,5 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::help::Help;

View file

@ -1,5 +1,6 @@
use yazi_config::popup::{Offset, Origin, Position};
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::{help::Help, input::Input};

View file

@ -1,3 +1 @@
mod arrow;
mod escape;
mod filter;
yazi_macro::mod_flat!(arrow, escape, filter);

View file

@ -2,7 +2,8 @@ use crossterm::event::KeyCode;
use unicode_width::UnicodeWidthStr;
use yazi_adapter::Dimension;
use yazi_config::{KEYMAP, keymap::{Chord, Key}};
use yazi_shared::{Layer, render, render_and};
use yazi_macro::{render, render_and};
use yazi_shared::Layer;
use super::HELP_MARGIN;
use crate::input::Input;

View file

@ -1,6 +1,5 @@
mod commands;
mod help;
yazi_macro::mod_pub!(commands);
pub use help::*;
yazi_macro::mod_flat!(help);
pub const HELP_MARGIN: u16 = 1;

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::Input;
pub struct Opt {
struct Opt {
under: bool,
}

View file

@ -1,9 +1,10 @@
use yazi_macro::render;
use yazi_proxy::CompletionProxy;
use yazi_shared::{InputError, event::Cmd, render};
use yazi_shared::{errors::InputError, event::Cmd};
use crate::input::Input;
pub struct Opt {
struct Opt {
submit: bool,
}

View file

@ -1,6 +1,7 @@
use std::path::MAIN_SEPARATOR_STR;
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::input::Input;
@ -10,7 +11,7 @@ const SEPARATOR: [char; 2] = ['/', '\\'];
#[cfg(not(windows))]
const SEPARATOR: char = std::path::MAIN_SEPARATOR;
pub struct Opt {
struct Opt {
word: String,
ticket: usize,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::{Input, op::InputOp};
pub struct Opt {
struct Opt {
cut: bool,
insert: bool,
}

View file

@ -1,9 +1,10 @@
use yazi_macro::render;
use yazi_proxy::CompletionProxy;
use yazi_shared::{event::Cmd, render};
use yazi_shared::event::Cmd;
use crate::input::{Input, InputMode, op::InputOp};
pub struct Opt;
struct Opt;
impl From<Cmd> for Opt {
fn from(_: Cmd) -> Self { Self }

View file

@ -2,7 +2,7 @@ use yazi_shared::{CharKind, event::Cmd};
use crate::input::{Input, op::InputOp};
pub struct Opt {
struct Opt {
end_of_word: bool,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::{Input, InputMode, op::InputOp};
pub struct Opt {
struct Opt {
append: bool,
}

View file

@ -1,10 +1,11 @@
use std::ops::RangeBounds;
use yazi_shared::{CharKind, event::Cmd, render};
use yazi_macro::render;
use yazi_shared::{CharKind, event::Cmd};
use crate::input::Input;
pub struct Opt {
struct Opt {
kind: String,
}

View file

@ -1,17 +1,4 @@
mod backspace;
mod backward;
mod close;
mod complete;
mod delete;
mod escape;
mod forward;
mod insert;
mod kill;
mod move_;
mod paste;
mod redo;
mod show;
mod type_;
mod undo;
mod visual;
mod yank;
yazi_macro::mod_flat!(
backspace, backward, close, complete, delete, escape, forward, insert, kill, move_, paste, redo,
show, type_, undo, visual, yank
);

View file

@ -1,9 +1,10 @@
use unicode_width::UnicodeWidthStr;
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::input::{Input, op::InputOp, snap::InputSnap};
pub struct Opt {
struct Opt {
step: isize,
in_operating: bool,
}

View file

@ -1,9 +1,10 @@
use yazi_macro::render;
use yazi_plugin::CLIPBOARD;
use yazi_shared::{event::Cmd, render};
use yazi_shared::event::Cmd;
use crate::input::{Input, op::InputOp};
pub struct Opt {
struct Opt {
before: bool,
}

View file

@ -1,4 +1,5 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::Input;

View file

@ -1,6 +1,7 @@
use tokio::sync::mpsc;
use yazi_config::popup::InputCfg;
use yazi_shared::{InputError, event::Cmd, render};
use yazi_macro::render;
use yazi_shared::{errors::InputError, event::Cmd};
use crate::input::Input;

View file

@ -3,7 +3,7 @@ use yazi_shared::event::Cmd;
use crate::input::{Input, InputMode};
pub struct Opt;
struct Opt;
impl From<Cmd> for Opt {
fn from(_: Cmd) -> Self { Self }

View file

@ -1,4 +1,5 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::{Input, InputMode};

View file

@ -1,4 +1,5 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::{Input, InputMode, op::InputOp};

View file

@ -1,4 +1,5 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::input::{Input, op::InputOp};

View file

@ -3,8 +3,9 @@ use std::ops::Range;
use tokio::sync::mpsc::UnboundedSender;
use unicode_width::UnicodeWidthStr;
use yazi_config::{INPUT, popup::Position};
use yazi_macro::render;
use yazi_plugin::CLIPBOARD;
use yazi_shared::{InputError, render};
use yazi_shared::errors::InputError;
use super::{InputSnap, InputSnaps, mode::InputMode, op::InputOp};

View file

@ -1,12 +1,3 @@
mod commands;
mod input;
mod mode;
mod op;
mod snap;
mod snaps;
yazi_macro::mod_pub!(commands);
pub use input::*;
pub use mode::*;
use op::*;
use snap::*;
use snaps::*;
yazi_macro::mod_flat!(input, mode, op, snap, snaps);

View file

@ -6,16 +6,7 @@
clippy::unit_arg
)]
pub mod completion;
pub mod confirm;
pub mod help;
pub mod input;
pub mod manager;
pub mod notify;
pub mod select;
pub mod tab;
pub mod tasks;
pub mod which;
yazi_macro::mod_pub!(completion, confirm, help, input, manager, notify, select, tab, tasks, which);
pub fn init() {
manager::WATCHED.with(<_>::default);

View file

@ -8,7 +8,7 @@ use yazi_shared::{event::Cmd, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_
use crate::manager::Manager;
pub struct Opt {
struct Opt {
dir: bool,
force: bool,
}

View file

@ -2,7 +2,7 @@ use yazi_shared::event::Cmd;
use crate::{manager::Manager, tasks::Tasks};
pub struct Opt {
struct Opt {
force: bool,
follow: bool,
}

View file

@ -1,11 +1,12 @@
use std::{collections::HashSet, path::PathBuf};
use yazi_dds::Pubsub;
use yazi_shared::{event::{Cmd, Data}, fs::{Url, Urn}, render};
use yazi_macro::render;
use yazi_shared::{event::{Cmd, Data}, fs::{Url, Urn}};
use crate::manager::Manager;
pub struct Opt {
struct Opt {
url: Option<Url>,
tab: Option<usize>,
}

View file

@ -2,7 +2,7 @@ use yazi_shared::event::Cmd;
use crate::{manager::Manager, tasks::Tasks};
pub struct Opt {
struct Opt {
relative: bool,
force: bool,
}

View file

@ -1,26 +1,28 @@
mod bulk_rename;
mod close;
mod create;
mod hardlink;
mod hover;
mod link;
mod open;
mod paste;
mod peek;
mod quit;
mod refresh;
mod remove;
mod rename;
mod seek;
mod suspend;
mod tab_close;
mod tab_create;
mod tab_swap;
mod tab_switch;
mod unyank;
mod update_files;
mod update_mimetype;
mod update_paged;
mod update_task;
mod update_yanked;
mod yank;
yazi_macro::mod_flat!(
bulk_rename,
close,
create,
hardlink,
hover,
link,
open,
paste,
peek,
quit,
refresh,
remove,
rename,
seek,
suspend,
tab_close,
tab_create,
tab_swap,
tab_switch,
unyank,
update_files,
update_mimetype,
update_paged,
update_task,
update_yanked,
yank
);

View file

@ -4,14 +4,15 @@ use tracing::error;
use yazi_boot::ARGS;
use yazi_config::{OPEN, popup::SelectCfg};
use yazi_fs::Folder;
use yazi_macro::emit;
use yazi_plugin::isolate;
use yazi_proxy::{ManagerProxy, TasksProxy, options::OpenDoOpt};
use yazi_shared::{MIME_DIR, emit, event::{Cmd, EventQuit}, fs::{File, Url}};
use yazi_shared::{MIME_DIR, event::{Cmd, EventQuit}, fs::{File, Url}};
use crate::{manager::Manager, tasks::Tasks};
#[derive(Clone, Copy)]
pub struct Opt {
struct Opt {
interactive: bool,
hovered: bool,
}

View file

@ -2,7 +2,7 @@ use yazi_shared::event::Cmd;
use crate::{manager::Manager, tasks::Tasks};
pub struct Opt {
struct Opt {
force: bool,
follow: bool,
}

View file

@ -3,7 +3,7 @@ use yazi_shared::{event::{Cmd, Data}, fs::Url};
use crate::manager::Manager;
#[derive(Debug, Default)]
pub struct Opt {
struct Opt {
skip: Option<usize>,
force: bool,
only_if: Option<Url>,

View file

@ -2,13 +2,14 @@ use std::time::Duration;
use tokio::{select, time};
use yazi_config::popup::ConfirmCfg;
use yazi_macro::emit;
use yazi_proxy::ConfirmProxy;
use yazi_shared::{emit, event::{Cmd, EventQuit}};
use yazi_shared::event::{Cmd, EventQuit};
use crate::{manager::Manager, tasks::Tasks};
#[derive(Default)]
pub struct Opt {
struct Opt {
no_cwd_file: bool,
}
impl From<()> for Opt {

View file

@ -4,7 +4,7 @@ use yazi_shared::{event::Cmd, fs::Url};
use crate::{manager::Manager, tasks::Tasks};
pub struct Opt {
struct Opt {
force: bool,
permanently: bool,
hovered: bool,

View file

@ -9,7 +9,7 @@ use yazi_shared::{event::Cmd, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_
use crate::manager::Manager;
pub struct Opt {
struct Opt {
hovered: bool,
force: bool,
empty: String,

View file

@ -5,7 +5,7 @@ use yazi_shared::{MIME_DIR, event::{Cmd, Data}};
use crate::manager::Manager;
#[derive(Debug)]
pub struct Opt {
struct Opt {
units: i16,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::manager::Tabs;
pub struct Opt {
struct Opt {
idx: usize,
}

View file

@ -1,12 +1,13 @@
use yazi_boot::BOOT;
use yazi_macro::render;
use yazi_proxy::AppProxy;
use yazi_shared::{event::{Cmd, Data}, fs::Url, render};
use yazi_shared::{event::{Cmd, Data}, fs::Url};
use crate::{manager::Tabs, tab::Tab};
const MAX_TABS: usize = 9;
pub struct Opt {
struct Opt {
url: Url,
current: bool,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::manager::Tabs;
pub struct Opt {
struct Opt {
step: isize,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::manager::Tabs;
pub struct Opt {
struct Opt {
step: isize,
relative: bool,
}

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::manager::Manager;
pub struct Opt;
struct Opt;
impl From<Cmd> for Opt {
fn from(_: Cmd) -> Self { Self }

View file

@ -1,8 +1,9 @@
use std::borrow::Cow;
use yazi_fs::Folder;
use yazi_macro::render;
use yazi_proxy::ManagerProxy;
use yazi_shared::{event::Cmd, fs::FilesOp, render};
use yazi_shared::{event::Cmd, fs::FilesOp};
use crate::{manager::{LINKED, Manager}, tab::Tab, tasks::Tasks};

View file

@ -1,7 +1,8 @@
use std::collections::HashMap;
use tracing::error;
use yazi_shared::{event::Cmd, fs::Url, render};
use yazi_macro::render;
use yazi_shared::{event::Cmd, fs::Url};
use crate::{manager::{LINKED, Manager}, tasks::Tasks};

View file

@ -1,6 +1,7 @@
use std::collections::HashSet;
use yazi_shared::{event::Cmd, fs::Url, render};
use yazi_macro::render;
use yazi_shared::{event::Cmd, fs::Url};
use crate::manager::{Manager, Yanked};

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::manager::{Manager, Yanked};
pub struct Opt {
struct Opt {
cut: bool,
}

View file

@ -1,14 +1,3 @@
mod commands;
mod linked;
mod manager;
mod mimetype;
mod tabs;
mod watcher;
mod yanked;
yazi_macro::mod_pub!(commands);
pub use linked::*;
pub use manager::*;
pub use mimetype::*;
pub use tabs::*;
pub use watcher::*;
pub use yanked::*;
yazi_macro::mod_flat!(linked, manager, mimetype, tabs, watcher, yanked);

View file

@ -1,2 +1 @@
mod push;
mod tick;
yazi_macro::mod_flat!(push, tick);

View file

@ -1,6 +1,7 @@
use std::time::Instant;
use yazi_shared::{Layer, emit, event::Cmd};
use yazi_macro::emit;
use yazi_shared::{Layer, event::Cmd};
use crate::notify::{Message, Notify};

View file

@ -1,7 +1,8 @@
use std::time::Duration;
use ratatui::layout::Rect;
use yazi_shared::{Layer, emit, event::{Cmd, Data}};
use yazi_macro::emit;
use yazi_shared::{Layer, event::{Cmd, Data}};
use crate::notify::Notify;

View file

@ -1,9 +1,6 @@
mod commands;
mod message;
mod notify;
yazi_macro::mod_pub!(commands);
pub use message::*;
pub use notify::*;
yazi_macro::mod_flat!(message, notify);
pub const NOTIFY_BORDER: u16 = 2;
pub const NOTIFY_SPACING: u16 = 1;

View file

@ -1,8 +1,9 @@
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_macro::render;
use yazi_shared::event::{Cmd, Data};
use crate::select::Select;
pub struct Opt {
struct Opt {
step: isize,
}

View file

@ -1,9 +1,10 @@
use anyhow::anyhow;
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::select::Select;
pub struct Opt {
struct Opt {
submit: bool,
}

View file

@ -1,3 +1 @@
mod arrow;
mod close;
mod show;
yazi_macro::mod_flat!(arrow, close, show);

View file

@ -1,6 +1,7 @@
use tokio::sync::oneshot;
use yazi_config::popup::SelectCfg;
use yazi_shared::{event::Cmd, render};
use yazi_macro::render;
use yazi_shared::event::Cmd;
use crate::select::Select;

View file

@ -1,4 +1,3 @@
mod commands;
mod select;
yazi_macro::mod_pub!(commands);
pub use select::*;
yazi_macro::mod_flat!(select);

View file

@ -1,10 +1,11 @@
use yazi_fs::Step;
use yazi_macro::render;
use yazi_proxy::ManagerProxy;
use yazi_shared::{event::{Cmd, Data}, render};
use yazi_shared::event::{Cmd, Data};
use crate::tab::Tab;
pub struct Opt {
struct Opt {
step: Step,
}

View file

@ -4,12 +4,13 @@ use tokio::{fs, pin};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use yazi_config::popup::InputCfg;
use yazi_dds::Pubsub;
use yazi_macro::render;
use yazi_proxy::{CompletionProxy, InputProxy, ManagerProxy, TabProxy};
use yazi_shared::{Debounce, InputError, event::{Cmd, Data}, fs::{Url, expand_path}, render};
use yazi_shared::{Debounce, errors::InputError, event::{Cmd, Data}, fs::{Url, expand_path}};
use crate::tab::Tab;
pub struct Opt {
struct Opt {
target: Url,
interactive: bool,
}

View file

@ -5,7 +5,7 @@ use yazi_shared::event::Cmd;
use crate::tab::Tab;
pub struct Opt {
struct Opt {
type_: String,
}

View file

@ -1,11 +1,12 @@
use bitflags::bitflags;
use yazi_macro::{render, render_and};
use yazi_proxy::{AppProxy, ManagerProxy};
use yazi_shared::{event::Cmd, render, render_and};
use yazi_shared::event::Cmd;
use crate::tab::Tab;
bitflags! {
pub struct Opt: u8 {
struct Opt: u8 {
const FIND = 0b00001;
const VISUAL = 0b00010;
const FILTER = 0b00100;

View file

@ -4,13 +4,14 @@ use tokio::pin;
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use yazi_config::popup::InputCfg;
use yazi_fs::FilterCase;
use yazi_macro::emit;
use yazi_proxy::InputProxy;
use yazi_shared::{Debounce, InputError, Layer, emit, event::Cmd};
use yazi_shared::{Debounce, Layer, errors::InputError, event::Cmd};
use crate::tab::Tab;
#[derive(Default)]
pub struct Opt {
pub(super) struct Opt {
pub query: String,
pub case: FilterCase,
pub done: bool,

View file

@ -1,6 +1,6 @@
use yazi_fs::Filter;
use yazi_macro::render;
use yazi_proxy::ManagerProxy;
use yazi_shared::render;
use super::filter::Opt;
use crate::tab::Tab;

View file

@ -4,12 +4,13 @@ use tokio::pin;
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use yazi_config::popup::InputCfg;
use yazi_fs::FilterCase;
use yazi_macro::emit;
use yazi_proxy::InputProxy;
use yazi_shared::{Debounce, InputError, Layer, emit, event::Cmd};
use yazi_shared::{Debounce, Layer, errors::InputError, event::Cmd};
use crate::tab::Tab;
pub struct Opt {
pub(super) struct Opt {
pub(super) query: Option<String>,
pub(super) prev: bool,
pub(super) case: FilterCase,

Some files were not shown because too many files have changed in this diff Show more