mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Merge branch 'main' into pr-fb9affc5
This commit is contained in:
commit
5ac760fdd1
10 changed files with 57 additions and 47 deletions
52
Cargo.lock
generated
52
Cargo.lock
generated
|
|
@ -571,9 +571,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fdeflate"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10"
|
||||
checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868"
|
||||
dependencies = [
|
||||
"simd-adler32",
|
||||
]
|
||||
|
|
@ -881,9 +881,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.0.2"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897"
|
||||
checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.14.2",
|
||||
|
|
@ -941,9 +941,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.64"
|
||||
version = "0.3.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
|
||||
checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
|
@ -1951,7 +1951,7 @@ version = "0.8.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc"
|
||||
dependencies = [
|
||||
"indexmap 2.0.2",
|
||||
"indexmap 2.1.0",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
|
|
@ -1973,7 +1973,7 @@ version = "0.20.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81"
|
||||
dependencies = [
|
||||
"indexmap 2.0.2",
|
||||
"indexmap 2.1.0",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
|
|
@ -2192,9 +2192,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
|
||||
checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"wasm-bindgen-macro",
|
||||
|
|
@ -2202,9 +2202,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
|
||||
checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log",
|
||||
|
|
@ -2217,9 +2217,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
|
||||
checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
|
|
@ -2227,9 +2227,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
||||
checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -2240,9 +2240,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
|
||||
checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
|
||||
|
||||
[[package]]
|
||||
name = "weezl"
|
||||
|
|
@ -2436,9 +2436,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
|||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.5.18"
|
||||
version = "0.5.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32"
|
||||
checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
@ -2471,7 +2471,7 @@ dependencies = [
|
|||
"dirs",
|
||||
"futures",
|
||||
"glob",
|
||||
"indexmap 2.0.2",
|
||||
"indexmap 2.1.0",
|
||||
"md-5",
|
||||
"ratatui",
|
||||
"serde",
|
||||
|
|
@ -2490,7 +2490,7 @@ dependencies = [
|
|||
"clipboard-win",
|
||||
"crossterm",
|
||||
"futures",
|
||||
"indexmap 2.0.2",
|
||||
"indexmap 2.1.0",
|
||||
"libc",
|
||||
"notify",
|
||||
"parking_lot",
|
||||
|
|
@ -2570,18 +2570,18 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.7.20"
|
||||
version = "0.7.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd66a62464e3ffd4e37bd09950c2b9dd6c4f8767380fabba0d523f9a775bc85a"
|
||||
checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.7.20"
|
||||
version = "0.7.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "255c4596d41e6916ced49cfafea18727b24d67878fa180ddfd69b9df34fd1726"
|
||||
checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"language":"en","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"]}
|
||||
{"language":"en","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"]}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use std::ops::ControlFlow;
|
||||
use std::{mem, ops::ControlFlow};
|
||||
|
||||
use yazi_config::keymap::Exec;
|
||||
|
||||
|
|
@ -46,17 +46,18 @@ impl Completion {
|
|||
ControlFlow::Continue(v)
|
||||
});
|
||||
|
||||
self.ticket = opt.ticket;
|
||||
self.cands = match flow {
|
||||
ControlFlow::Continue(v) => v,
|
||||
ControlFlow::Break(v) => v,
|
||||
};
|
||||
self.ticket = opt.ticket;
|
||||
|
||||
if !self.cands.is_empty() {
|
||||
self.offset = 0;
|
||||
self.cursor = 0;
|
||||
self.visible = true;
|
||||
if self.cands.is_empty() {
|
||||
return mem::replace(&mut self.visible, false);
|
||||
}
|
||||
|
||||
self.offset = 0;
|
||||
self.cursor = 0;
|
||||
self.visible = true;
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use crate::{emit, tab::Tab};
|
|||
|
||||
impl Tab {
|
||||
pub fn hidden(&mut self, e: &Exec) -> bool {
|
||||
self.conf.show_hidden = match e.args.get(0).map(|s| s.as_bytes()) {
|
||||
self.conf.show_hidden = match e.args.first().map(|s| s.as_bytes()) {
|
||||
Some(b"show") => true,
|
||||
Some(b"hide") => false,
|
||||
_ => !self.conf.show_hidden,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::tab::Tab;
|
|||
impl Tab {
|
||||
pub fn linemode(&mut self, e: &Exec) -> bool {
|
||||
self.conf.patch(|c| {
|
||||
let Some(mode) = e.args.get(0) else {
|
||||
let Some(mode) = e.args.first() else {
|
||||
return;
|
||||
};
|
||||
if !mode.is_empty() && mode.len() <= 20 {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use crate::tab::Tab;
|
|||
|
||||
impl Tab {
|
||||
pub fn sort(&mut self, e: &Exec) -> bool {
|
||||
if let Some(by) = e.args.get(0) {
|
||||
if let Some(by) = e.args.first() {
|
||||
self.conf.sort_by = SortBy::from_str(by).unwrap_or_default();
|
||||
}
|
||||
self.conf.sort_sensitive = e.named.contains_key("sensitive");
|
||||
|
|
|
|||
|
|
@ -93,6 +93,10 @@ impl Folder {
|
|||
}
|
||||
|
||||
pub fn hover(&mut self, url: &Url) -> bool {
|
||||
if self.hovered().map(|h| &h.url) == Some(url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let new = self.files.position(url).unwrap_or(self.cursor);
|
||||
if new > self.cursor {
|
||||
self.next(Step::next(new - self.cursor))
|
||||
|
|
|
|||
|
|
@ -100,28 +100,29 @@ impl Tab {
|
|||
}
|
||||
|
||||
pub fn apply_files_attrs(&mut self, just_preview: bool) -> bool {
|
||||
let apply = |f: &mut Folder| {
|
||||
let hovered = f.hovered().map(|h| h.url());
|
||||
|
||||
let mut b = f.files.set_show_hidden(self.conf.show_hidden);
|
||||
b |= f.files.set_sorter(self.conf.sorter());
|
||||
b | f.repos(hovered)
|
||||
};
|
||||
|
||||
let mut b = false;
|
||||
if let Some(f) =
|
||||
self.current.hovered().filter(|h| h.is_dir()).and_then(|h| self.history.get_mut(&h.url))
|
||||
{
|
||||
b |= f.files.set_show_hidden(self.conf.show_hidden);
|
||||
b |= f.files.set_sorter(self.conf.sorter());
|
||||
b |= apply(f);
|
||||
}
|
||||
|
||||
if just_preview {
|
||||
return b;
|
||||
}
|
||||
|
||||
let hovered = self.current.hovered().map(|h| h.url());
|
||||
b |= self.current.files.set_show_hidden(self.conf.show_hidden);
|
||||
b |= self.current.files.set_sorter(self.conf.sorter());
|
||||
|
||||
b |= apply(&mut self.current);
|
||||
if let Some(parent) = self.parent.as_mut() {
|
||||
b |= parent.files.set_show_hidden(self.conf.show_hidden);
|
||||
b |= parent.files.set_sorter(self.conf.sorter());
|
||||
b |= apply(parent);
|
||||
}
|
||||
|
||||
self.current.repos(hovered);
|
||||
b
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ ui = {
|
|||
ROUNDED = 1,
|
||||
DOUBLE = 2,
|
||||
THICK = 3,
|
||||
QUADRANT_INSIDE = 4,
|
||||
QUADRANT_OUTSIDE = 5,
|
||||
}, {
|
||||
__call = function(_, ...) return ui.Border.new(...) end,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ impl UserData for Border {
|
|||
1 => ratatui::widgets::BorderType::Rounded,
|
||||
2 => ratatui::widgets::BorderType::Double,
|
||||
3 => ratatui::widgets::BorderType::Thick,
|
||||
4 => ratatui::widgets::BorderType::QuadrantInside,
|
||||
5 => ratatui::widgets::BorderType::QuadrantOutside,
|
||||
_ => ratatui::widgets::BorderType::Plain,
|
||||
};
|
||||
Ok(ud)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue