diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-09-04 15:00:56 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-09-04 15:00:56 -0400 |
commit | 7741d4d2c8798ad0bb609e97fb3bda86c5318a36 (patch) | |
tree | 0176023bbe8dfff48198ba960f64a08ee785569f /src/commands | |
parent | e6e35948545bfa14d672cafae92c2c8c153ba708 (diff) |
io operations now give more information
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/file_ops/copy.rs | 2 | ||||
-rw-r--r-- | src/commands/open_file.rs | 9 | ||||
-rw-r--r-- | src/commands/selection.rs | 11 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src/commands/file_ops/copy.rs b/src/commands/file_ops/copy.rs index 138aac3..c741347 100644 --- a/src/commands/file_ops/copy.rs +++ b/src/commands/file_ops/copy.rs @@ -1,5 +1,3 @@ -use std::path; - use crate::commands::{JoshutoCommand, JoshutoRunnable}; use crate::context::{JoshutoContext, LocalStateContext}; use crate::error::JoshutoResult; diff --git a/src/commands/open_file.rs b/src/commands/open_file.rs index ce66aa5..7299b74 100644 --- a/src/commands/open_file.rs +++ b/src/commands/open_file.rs @@ -4,8 +4,7 @@ use crate::commands::{ChangeDirectory, JoshutoCommand, JoshutoRunnable}; use crate::config::mimetype::JoshutoMimetypeEntry; use crate::context::JoshutoContext; use crate::error::{JoshutoError, JoshutoErrorKind, JoshutoResult}; -use crate::fs::JoshutoDirEntry; -use crate::ui::widgets::{TuiMenu, TuiTextField}; +use crate::ui::widgets::TuiTextField; use crate::ui::TuiBackend; use crate::util::load_child::LoadChild; @@ -92,13 +91,13 @@ impl JoshutoRunnable for OpenFile { if !options.is_empty() { if options[0].get_fork() { - options[0].execute_with(files.as_slice()) + options[0].execute_with(files.as_slice())?; } else { backend.terminal_drop(); let res = options[0].execute_with(files.as_slice()); backend.terminal_restore()?; - res - }; + res?; + } } else { OpenFileWith::open_with(context, backend, options, files)?; } diff --git a/src/commands/selection.rs b/src/commands/selection.rs index aced34f..e2c80f9 100644 --- a/src/commands/selection.rs +++ b/src/commands/selection.rs @@ -63,12 +63,11 @@ impl JoshutoRunnable for SelectFiles { s.set_selected(!s.is_selected()); CursorMoveDown::new(1).execute(context, backend)?; } - } else { - if let Some(curr_list) = context.tab_context_mut().curr_tab_mut().curr_list_mut() { - for curr in &mut curr_list.contents { - curr.set_selected(true); - } - } + } else if let Some(curr_list) = context.tab_context_mut().curr_tab_mut().curr_list_mut() { + curr_list + .contents + .iter_mut() + .for_each(|c| c.set_selected(true)); } Ok(()) } |