mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: reset the cursor position with arrow() after deleting files (#2708)
This commit is contained in:
parent
9037f8b8c0
commit
01a13fd664
1 changed files with 2 additions and 1 deletions
|
|
@ -70,7 +70,8 @@ impl Folder {
|
|||
FilesOp::Creating(_, files) => self.files.update_creating(files),
|
||||
FilesOp::Deleting(_, urns) => {
|
||||
let deleted = self.files.update_deleting(urns);
|
||||
self.cursor -= deleted.into_iter().filter(|&i| i < self.cursor).count();
|
||||
let delta = deleted.into_iter().filter(|&i| i < self.cursor).count() as isize;
|
||||
self.arrow(-delta);
|
||||
}
|
||||
FilesOp::Updating(_, files) => _ = self.files.update_updating(files),
|
||||
FilesOp::Upserting(_, files) => self.files.update_upserting(files),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue