diff --git a/yazi-core/src/notify/commands/tick.rs b/yazi-core/src/notify/commands/tick.rs index 247c351c..ba8536cf 100644 --- a/yazi-core/src/notify/commands/tick.rs +++ b/yazi-core/src/notify/commands/tick.rs @@ -38,7 +38,7 @@ impl Notify { if m.timeout.is_zero() { m.percent = m.percent.saturating_sub(20); } else if m.percent < 100 { - m.percent = m.percent.saturating_add(20); + m.percent += 20; } else { m.timeout = m.timeout.saturating_sub(opt.interval); } diff --git a/yazi-core/src/tab/commands/escape.rs b/yazi-core/src/tab/commands/escape.rs index b259b711..ac7b4361 100644 --- a/yazi-core/src/tab/commands/escape.rs +++ b/yazi-core/src/tab/commands/escape.rs @@ -103,28 +103,23 @@ impl Tab { return true; }; - let results: Vec<_> = indices - .iter() - .filter_map(|i| self.current.files.get(*i)) - .map(|f| { - if state { - self.selected.add(&f.url) - } else { - self.selected.remove(&f.url); - true - } - }) - .collect(); - - render!(!results.is_empty()); - if results.into_iter().all(|b| b) { - return true; + let mut success = true; + for f in indices.iter().filter_map(|i| self.current.files.get(*i)) { + if state { + success &= self.selected.add(&f.url); + } else { + self.selected.remove(&f.url); + } } - Notify::_push_warn( - "Escape visual mode", - "Some files cannot be selected due to path nesting conflict.", - ); - false + if !success { + Notify::_push_warn( + "Escape visual mode", + "Some files cannot be selected, due to path nesting conflict.", + ); + } + + render!(); + success } }