Skip to content

Commit

Permalink
chore: bump version to 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Feb 7, 2024
1 parent fab5bc1 commit 0d7e977
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 70 deletions.
35 changes: 28 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions yazi-adaptor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yazi-adaptor"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
license = "MIT"
authors = [ "sxyazi <sxyazi@gmail.com>" ]
Expand All @@ -9,8 +9,8 @@ homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"

[dependencies]
yazi-config = { path = "../yazi-config", version = "0.2.2" }
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
yazi-config = { path = "../yazi-config", version = "0.2.3" }
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }

# External dependencies
anyhow = "^1"
Expand Down
4 changes: 2 additions & 2 deletions yazi-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yazi-config"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
license = "MIT"
authors = [ "sxyazi <sxyazi@gmail.com>" ]
Expand All @@ -9,7 +9,7 @@ homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"

[dependencies]
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }

# External dependencies
anyhow = "^1"
Expand Down
12 changes: 6 additions & 6 deletions yazi-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yazi-core"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
license = "MIT"
authors = [ "sxyazi <sxyazi@gmail.com>" ]
Expand All @@ -9,11 +9,11 @@ homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"

[dependencies]
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.2" }
yazi-config = { path = "../yazi-config", version = "0.2.2" }
yazi-plugin = { path = "../yazi-plugin", version = "0.2.2" }
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.2" }
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.3" }
yazi-config = { path = "../yazi-config", version = "0.2.3" }
yazi-plugin = { path = "../yazi-plugin", version = "0.2.3" }
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.3" }
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }

# External dependencies
anyhow = "^1"
Expand Down
32 changes: 16 additions & 16 deletions yazi-core/src/folder/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,26 +208,26 @@ impl Files {
}

macro_rules! go {
($dist:expr, $src:expr) => {
($dist:expr, $src:expr, $inc:literal) => {
let mut todo: BTreeMap<_, _> = $src.into_iter().map(|f| (f.url(), f)).collect();
for f in &$dist {
if todo.remove(&f.url).is_some() && todo.is_empty() {
break;
}
}
if !todo.is_empty() {
self.revision += 1;
self.revision += $inc;
$dist.extend(todo.into_values());
}
};
}

let (hidden, items) = self.split_files(files);
if !items.is_empty() {
go!(self.items, items);
go!(self.items, items, 1);
}
if !hidden.is_empty() {
go!(self.hidden, hidden);
go!(self.hidden, hidden, 0);
}
}

Expand All @@ -238,13 +238,13 @@ impl Files {
}

macro_rules! go {
($dist:expr, $src:expr) => {
($dist:expr, $src:expr, $inc:literal) => {
let mut todo: BTreeSet<_> = $src.into_iter().collect();
let len = $dist.len();

$dist.retain(|f| !todo.remove(&f.url));
if $dist.len() != len {
self.revision += 1;
self.revision += $inc;
}
};
}
Expand All @@ -260,32 +260,32 @@ impl Files {
};

if !items.is_empty() {
go!(self.items, items);
go!(self.items, items, 1);
}
if !hidden.is_empty() {
go!(self.hidden, hidden);
go!(self.hidden, hidden, 0);
}
}

#[cfg(windows)]
pub fn update_deleting(&mut self, urls: Vec<Url>) {
macro_rules! go {
($dist:expr, $src:expr) => {
($dist:expr, $src:expr, $inc:literal) => {
let len = $dist.len();

$dist.retain(|f| !$src.remove(&f.url));
if $dist.len() != len {
self.revision += 1;
self.revision += $inc;
}
};
}

let mut urls: BTreeSet<_> = urls.into_iter().collect();
if !urls.is_empty() {
go!(self.items, urls);
go!(self.items, urls, 1);
}
if !urls.is_empty() {
go!(self.hidden, urls);
go!(self.hidden, urls, 0);
}
}

Expand All @@ -298,7 +298,7 @@ impl Files {
}

macro_rules! go {
($dist:expr, $src:expr) => {
($dist:expr, $src:expr, $inc:literal) => {
let len = $src.len();
for i in 0..$dist.len() {
if let Some(f) = $src.remove(&$dist[i].url) {
Expand All @@ -309,7 +309,7 @@ impl Files {
}
}
if $src.len() != len {
self.revision += 1;
self.revision += $inc;
}
};
}
Expand All @@ -326,10 +326,10 @@ impl Files {
};

if !items.is_empty() {
go!(self.items, items);
go!(self.items, items, 1);
}
if !hidden.is_empty() {
go!(self.hidden, hidden);
go!(self.hidden, hidden, 0);
}
(hidden, items)
}
Expand Down
17 changes: 10 additions & 7 deletions yazi-core/src/manager/commands/peek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ impl Manager {
}

pub fn peek(&mut self, opt: impl Into<Opt>) {
let Some(hovered) = self.hovered() else {
let Some(hovered) = self.hovered().cloned() else {
return render!(self.active_mut().preview.reset());
};

let hovered = hovered.clone();
let folder = Some(())
.filter(|_| hovered.is_dir())
.and_then(|_| self.active().history.get(&hovered.url))
.map(|f| (f.offset, f.mtime));

if !self.active().preview.same_url(&hovered.url) {
self.active_mut().preview.skip = 0;
self.active_mut().preview.skip = folder.map(|f| f.0).unwrap_or_default();
render!(self.active_mut().preview.reset());
}

Expand All @@ -56,13 +60,12 @@ impl Manager {
}

if hovered.is_dir() {
let mtime = self.active().history.get(&hovered.url).and_then(|f| f.mtime);
self.active_mut().preview.go_folder(hovered, mtime, opt.force);
self.active_mut().preview.go_folder(hovered, folder.and_then(|f| f.1), opt.force);
return;
}

if let Some(m) = self.mimetype.get(&hovered.url).cloned() {
self.active_mut().preview.go(hovered, &m, opt.force);
if let Some(mime) = self.mimetype.get(&hovered.url).cloned() {
self.active_mut().preview.go(hovered, &mime, opt.force);
} else {
render!(self.active_mut().preview.reset());
}
Expand Down
3 changes: 2 additions & 1 deletion yazi-core/src/manager/commands/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl Manager {
}

let file = File::from(new.clone()).await?;
FilesOp::Deleting(file.parent().unwrap(), vec![new.clone()]).emit();
FilesOp::Upserting(file.parent().unwrap(), BTreeMap::from_iter([(old, file)])).emit();
Ok(Self::_hover(Some(new)))
}
Expand Down Expand Up @@ -160,7 +161,7 @@ impl Manager {
}

let mut buf = [0; 10];
stdin().read(&mut buf).await.ok();
_ = stdin().read(&mut buf).await?;
if buf[0] != b'y' && buf[0] != b'Y' {
return Ok(());
}
Expand Down
11 changes: 6 additions & 5 deletions yazi-core/src/tasks/commands/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Tasks {
enable_raw_mode().ok();

let mut stdin = stdin();
let mut quit = [0; 10];
let mut answer = 0;
loop {
select! {
Some(line) = rx.recv() => {
Expand All @@ -51,8 +51,9 @@ impl Tasks {
break;
}
},
Ok(_) = stdin.read(&mut quit) => {
if quit[0] == b'q' {
result = stdin.read_u8() => {
answer = result.unwrap_or(b'q');
if answer == b'q' {
break;
}
}
Expand All @@ -62,8 +63,8 @@ impl Tasks {
if let Some(task) = scheduler.running.lock().get_mut(id) {
task.logger = None;
}
while quit[0] != b'q' {
stdin.read(&mut quit).await.ok();
while answer != b'q' {
answer = stdin.read_u8().await.unwrap_or(b'q');
}
});
}
Expand Down
15 changes: 8 additions & 7 deletions yazi-fm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yazi-fm"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
license = "MIT"
authors = [ "sxyazi <sxyazi@gmail.com>" ]
Expand All @@ -9,12 +9,12 @@ homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"

[dependencies]
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.2" }
yazi-config = { path = "../yazi-config", version = "0.2.2" }
yazi-core = { path = "../yazi-core", version = "0.2.2" }
yazi-plugin = { path = "../yazi-plugin", version = "0.2.2" }
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.2" }
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.3" }
yazi-config = { path = "../yazi-config", version = "0.2.3" }
yazi-core = { path = "../yazi-core", version = "0.2.3" }
yazi-plugin = { path = "../yazi-plugin", version = "0.2.3" }
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.3" }
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }

# External dependencies
anyhow = "^1"
Expand All @@ -37,6 +37,7 @@ tracing-subscriber = "^0"
[target."cfg(unix)".dependencies]
libc = "^0"
signal-hook-tokio = { version = "^0", features = [ "futures-v0_3" ] }
tikv-jemallocator = "^0"

[[bin]]
name = "yazi"
Expand Down

0 comments on commit 0d7e977

Please sign in to comment.