diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-02-25 13:18:10 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-02-25 13:23:17 -0500 |
commit | 2ed8a79d7ba89bd37b89c1cd853ead3adb59347a (patch) | |
tree | 81fc8ed2c72170d9009e67762a1395bb01b0b396 | |
parent | 25d52bebb94b7a9dcaf45d839fd320b6fa3a3782 (diff) |
add verbose messages for file operations
-rw-r--r-- | src/commands/change_directory.rs | 1 | ||||
-rw-r--r-- | src/commands/delete_files.rs | 6 | ||||
-rw-r--r-- | src/commands/file_operations.rs | 3 | ||||
-rw-r--r-- | src/run.rs | 6 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/commands/change_directory.rs b/src/commands/change_directory.rs index de0f418..0b96145 100644 --- a/src/commands/change_directory.rs +++ b/src/commands/change_directory.rs @@ -1,5 +1,4 @@ use std::path; -use std::process; use crate::commands::{JoshutoCommand, JoshutoRunnable}; use crate::context::JoshutoContext; diff --git a/src/commands/delete_files.rs b/src/commands/delete_files.rs index e72d364..3823f57 100644 --- a/src/commands/delete_files.rs +++ b/src/commands/delete_files.rs @@ -51,7 +51,11 @@ impl JoshutoRunnable for DeleteFiles { if let Some(paths) = commands::collect_selected_paths(s) { match Self::remove_files(paths) { Ok(_) => ui::wprint_msg(&context.views.bot_win, "Deleted files"), - Err(e) => ui::wprint_err(&context.views.bot_win, e.to_string().as_str()), + Err(e) => { + ui::wprint_err(&context.views.bot_win, e.to_string().as_str()); + ncurses::doupdate(); + return; + } } } } diff --git a/src/commands/file_operations.rs b/src/commands/file_operations.rs index aee5232..ab28220 100644 --- a/src/commands/file_operations.rs +++ b/src/commands/file_operations.rs @@ -279,8 +279,7 @@ impl PasteFiles { tx.send(progress_info).unwrap(); fs_extra::dir::TransitProcessResult::ContinueOrAbort }; - fs_extra::copy_items_with_progress(&paths, &destination, &options, handle).unwrap(); - + fs_extra::copy_items_with_progress(&paths, &destination, &options, handle); paths.clear(); 0 }); @@ -9,9 +9,7 @@ use crate::preview; use crate::ui; use crate::window::JoshutoPanel; -fn recurse_get_keycommand( - keymap: &HashMap<i32, CommandKeybind>, -) -> Option<&Box<JoshutoCommand>> { +fn recurse_get_keycommand(keymap: &HashMap<i32, CommandKeybind>) -> Option<&Box<JoshutoCommand>> { let (term_rows, term_cols) = ui::getmaxyx(); ncurses::timeout(-1); @@ -49,6 +47,7 @@ fn recurse_get_keycommand( } } +#[inline] fn process_threads(context: &mut JoshutoContext) { let thread_wait_duration: time::Duration = time::Duration::from_millis(100); @@ -129,6 +128,7 @@ fn process_threads(context: &mut JoshutoContext) { } } +#[inline] fn resize_handler(context: &mut JoshutoContext) { ui::redraw_tab_view(&context.views.tab_win, &context); { |