mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: wrong resetting of the cursor after the task canceled
This commit is contained in:
parent
b49de866c1
commit
51e1110ca0
1 changed files with 3 additions and 3 deletions
|
|
@ -121,12 +121,12 @@ impl Tasks {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cancel(&mut self) -> bool {
|
pub fn cancel(&mut self) -> bool {
|
||||||
let id = self.scheduler.running.read().get_id(self.cursor);
|
let running = self.scheduler.running.read();
|
||||||
if !id.map(|id| self.scheduler.cancel(id)).unwrap_or(false) {
|
if !running.get_id(self.cursor).map(|id| self.scheduler.cancel(id)).unwrap_or(false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.next();
|
self.cursor = self.cursor.min(running.len().saturating_sub(1));
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue