diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-02-16 16:40:20 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-02-16 16:40:20 -0500 |
commit | 88da91c0f97dcb40e7e4cab54941af92a46d2e1a (patch) | |
tree | d5e7fa33842c19b32bfc834e531e2b942813e985 /src/commands/delete_files.rs | |
parent | 98d0ce7e70f9febf804cda7473f5e9f7f180fe91 (diff) |
remove more code
- remove curr_list field from tab
- fixes many commands not working
Diffstat (limited to 'src/commands/delete_files.rs')
-rw-r--r-- | src/commands/delete_files.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/commands/delete_files.rs b/src/commands/delete_files.rs index ed35630..f1ce09d 100644 --- a/src/commands/delete_files.rs +++ b/src/commands/delete_files.rs @@ -33,7 +33,11 @@ impl DeleteFiles { fn delete_files(context: &mut JoshutoContext, backend: &mut TuiBackend) -> std::io::Result<()> { let curr_tab = &mut context.tabs[context.curr_tab_index]; - let paths = curr_tab.curr_list.get_selected_paths(); + let paths = match curr_tab.curr_list_ref() { + Some(s) => s.get_selected_paths(), + None => Vec::new(), + }; + if paths.is_empty() { return Err(std::io::Error::new( std::io::ErrorKind::Other, |