mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Solved index of files list no more kept after 0.3.0 (use set_abs_index instead)
This commit is contained in:
@@ -603,9 +603,9 @@ impl FileTransferActivity {
|
||||
let prev_index: usize = self.local.get_index();
|
||||
self.local.set_files(files);
|
||||
// Restore index
|
||||
self.local.set_index(prev_index);
|
||||
self.local.set_abs_index(prev_index);
|
||||
// Set index; keep if possible, otherwise set to last item
|
||||
self.local.set_index(match self.local.get_current_file() {
|
||||
self.local.set_abs_index(match self.local.get_current_file() {
|
||||
Some(_) => self.local.get_index(),
|
||||
None => match self.local.count() {
|
||||
0 => 0,
|
||||
@@ -632,9 +632,9 @@ impl FileTransferActivity {
|
||||
let prev_index: usize = self.remote.get_index();
|
||||
self.remote.set_files(files);
|
||||
// Restore index
|
||||
self.remote.set_index(prev_index);
|
||||
self.remote.set_abs_index(prev_index);
|
||||
// Set index; keep if possible, otherwise set to last item
|
||||
self.remote.set_index(match self.remote.get_current_file() {
|
||||
self.remote.set_abs_index(match self.remote.get_current_file() {
|
||||
Some(_) => self.remote.get_index(),
|
||||
None => match self.remote.count() {
|
||||
0 => 0,
|
||||
|
||||
Reference in New Issue
Block a user