Skip to content

Commit 0d7e977

Browse files
committed
chore: bump version to 0.2.3
1 parent fab5bc1 commit 0d7e977

File tree

14 files changed

+104
-70
lines changed

14 files changed

+104
-70
lines changed

Diff for: Cargo.lock

+28-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: yazi-adaptor/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-adaptor"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,8 +9,8 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-config = { path = "../yazi-config", version = "0.2.2" }
13-
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
12+
yazi-config = { path = "../yazi-config", version = "0.2.3" }
13+
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }
1414

1515
# External dependencies
1616
anyhow = "^1"

Diff for: yazi-config/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-config"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,7 +9,7 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

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

1414
# External dependencies
1515
anyhow = "^1"

Diff for: yazi-core/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-core"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,11 +9,11 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.2" }
13-
yazi-config = { path = "../yazi-config", version = "0.2.2" }
14-
yazi-plugin = { path = "../yazi-plugin", version = "0.2.2" }
15-
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.2" }
16-
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
12+
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.3" }
13+
yazi-config = { path = "../yazi-config", version = "0.2.3" }
14+
yazi-plugin = { path = "../yazi-plugin", version = "0.2.3" }
15+
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.3" }
16+
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }
1717

1818
# External dependencies
1919
anyhow = "^1"

Diff for: yazi-core/src/folder/files.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -208,26 +208,26 @@ impl Files {
208208
}
209209

210210
macro_rules! go {
211-
($dist:expr, $src:expr) => {
211+
($dist:expr, $src:expr, $inc:literal) => {
212212
let mut todo: BTreeMap<_, _> = $src.into_iter().map(|f| (f.url(), f)).collect();
213213
for f in &$dist {
214214
if todo.remove(&f.url).is_some() && todo.is_empty() {
215215
break;
216216
}
217217
}
218218
if !todo.is_empty() {
219-
self.revision += 1;
219+
self.revision += $inc;
220220
$dist.extend(todo.into_values());
221221
}
222222
};
223223
}
224224

225225
let (hidden, items) = self.split_files(files);
226226
if !items.is_empty() {
227-
go!(self.items, items);
227+
go!(self.items, items, 1);
228228
}
229229
if !hidden.is_empty() {
230-
go!(self.hidden, hidden);
230+
go!(self.hidden, hidden, 0);
231231
}
232232
}
233233

@@ -238,13 +238,13 @@ impl Files {
238238
}
239239

240240
macro_rules! go {
241-
($dist:expr, $src:expr) => {
241+
($dist:expr, $src:expr, $inc:literal) => {
242242
let mut todo: BTreeSet<_> = $src.into_iter().collect();
243243
let len = $dist.len();
244244

245245
$dist.retain(|f| !todo.remove(&f.url));
246246
if $dist.len() != len {
247-
self.revision += 1;
247+
self.revision += $inc;
248248
}
249249
};
250250
}
@@ -260,32 +260,32 @@ impl Files {
260260
};
261261

262262
if !items.is_empty() {
263-
go!(self.items, items);
263+
go!(self.items, items, 1);
264264
}
265265
if !hidden.is_empty() {
266-
go!(self.hidden, hidden);
266+
go!(self.hidden, hidden, 0);
267267
}
268268
}
269269

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

276276
$dist.retain(|f| !$src.remove(&f.url));
277277
if $dist.len() != len {
278-
self.revision += 1;
278+
self.revision += $inc;
279279
}
280280
};
281281
}
282282

283283
let mut urls: BTreeSet<_> = urls.into_iter().collect();
284284
if !urls.is_empty() {
285-
go!(self.items, urls);
285+
go!(self.items, urls, 1);
286286
}
287287
if !urls.is_empty() {
288-
go!(self.hidden, urls);
288+
go!(self.hidden, urls, 0);
289289
}
290290
}
291291

@@ -298,7 +298,7 @@ impl Files {
298298
}
299299

300300
macro_rules! go {
301-
($dist:expr, $src:expr) => {
301+
($dist:expr, $src:expr, $inc:literal) => {
302302
let len = $src.len();
303303
for i in 0..$dist.len() {
304304
if let Some(f) = $src.remove(&$dist[i].url) {
@@ -309,7 +309,7 @@ impl Files {
309309
}
310310
}
311311
if $src.len() != len {
312-
self.revision += 1;
312+
self.revision += $inc;
313313
}
314314
};
315315
}
@@ -326,10 +326,10 @@ impl Files {
326326
};
327327

328328
if !items.is_empty() {
329-
go!(self.items, items);
329+
go!(self.items, items, 1);
330330
}
331331
if !hidden.is_empty() {
332-
go!(self.hidden, hidden);
332+
go!(self.hidden, hidden, 0);
333333
}
334334
(hidden, items)
335335
}

Diff for: yazi-core/src/manager/commands/peek.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ impl Manager {
3131
}
3232

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

38-
let hovered = hovered.clone();
38+
let folder = Some(())
39+
.filter(|_| hovered.is_dir())
40+
.and_then(|_| self.active().history.get(&hovered.url))
41+
.map(|f| (f.offset, f.mtime));
42+
3943
if !self.active().preview.same_url(&hovered.url) {
40-
self.active_mut().preview.skip = 0;
44+
self.active_mut().preview.skip = folder.map(|f| f.0).unwrap_or_default();
4145
render!(self.active_mut().preview.reset());
4246
}
4347

@@ -56,13 +60,12 @@ impl Manager {
5660
}
5761

5862
if hovered.is_dir() {
59-
let mtime = self.active().history.get(&hovered.url).and_then(|f| f.mtime);
60-
self.active_mut().preview.go_folder(hovered, mtime, opt.force);
63+
self.active_mut().preview.go_folder(hovered, folder.and_then(|f| f.1), opt.force);
6164
return;
6265
}
6366

64-
if let Some(m) = self.mimetype.get(&hovered.url).cloned() {
65-
self.active_mut().preview.go(hovered, &m, opt.force);
67+
if let Some(mime) = self.mimetype.get(&hovered.url).cloned() {
68+
self.active_mut().preview.go(hovered, &mime, opt.force);
6669
} else {
6770
render!(self.active_mut().preview.reset());
6871
}

Diff for: yazi-core/src/manager/commands/rename.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ impl Manager {
4747
}
4848

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

162163
let mut buf = [0; 10];
163-
stdin().read(&mut buf).await.ok();
164+
_ = stdin().read(&mut buf).await?;
164165
if buf[0] != b'y' && buf[0] != b'Y' {
165166
return Ok(());
166167
}

Diff for: yazi-core/src/tasks/commands/inspect.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Tasks {
3737
enable_raw_mode().ok();
3838

3939
let mut stdin = stdin();
40-
let mut quit = [0; 10];
40+
let mut answer = 0;
4141
loop {
4242
select! {
4343
Some(line) = rx.recv() => {
@@ -51,8 +51,9 @@ impl Tasks {
5151
break;
5252
}
5353
},
54-
Ok(_) = stdin.read(&mut quit) => {
55-
if quit[0] == b'q' {
54+
result = stdin.read_u8() => {
55+
answer = result.unwrap_or(b'q');
56+
if answer == b'q' {
5657
break;
5758
}
5859
}
@@ -62,8 +63,8 @@ impl Tasks {
6263
if let Some(task) = scheduler.running.lock().get_mut(id) {
6364
task.logger = None;
6465
}
65-
while quit[0] != b'q' {
66-
stdin.read(&mut quit).await.ok();
66+
while answer != b'q' {
67+
answer = stdin.read_u8().await.unwrap_or(b'q');
6768
}
6869
});
6970
}

Diff for: yazi-fm/Cargo.toml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-fm"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,12 +9,12 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.2" }
13-
yazi-config = { path = "../yazi-config", version = "0.2.2" }
14-
yazi-core = { path = "../yazi-core", version = "0.2.2" }
15-
yazi-plugin = { path = "../yazi-plugin", version = "0.2.2" }
16-
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.2" }
17-
yazi-shared = { path = "../yazi-shared", version = "0.2.2" }
12+
yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.3" }
13+
yazi-config = { path = "../yazi-config", version = "0.2.3" }
14+
yazi-core = { path = "../yazi-core", version = "0.2.3" }
15+
yazi-plugin = { path = "../yazi-plugin", version = "0.2.3" }
16+
yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.3" }
17+
yazi-shared = { path = "../yazi-shared", version = "0.2.3" }
1818

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

4142
[[bin]]
4243
name = "yazi"

0 commit comments

Comments
 (0)