use std::borrow::Borrow;
use std::cmp::min;
use std::fs;
use std::path;
use copypasta::{ClipboardContext, ClipboardProvider};
use log::info;
use sysinfo::SystemExt;
use crate::bulkrename::Bulkrename;
use crate::completion::InputCompleted;
use crate::constant_strings_paths::DEFAULT_DRAGNDROP;
use crate::constant_strings_paths::NVIM_RPC_SENDER;
use crate::content_window::RESERVED_ROWS;
use crate::copy_move::CopyMove;
use crate::fileinfo::FileKind;
use crate::filter::FilterKind;
use crate::fm_error::{FmError, FmResult};
use crate::mode::Navigate;
use crate::mode::{InputSimple, MarkAction, Mode, NeedConfirmation};
use crate::opener::execute_in_child;
use crate::preview::Preview;
use crate::selectable_content::SelectableContent;
use crate::status::Status;
use crate::tab::Tab;
use crate::term_manager::MIN_WIDTH_FOR_DUAL_PANE;
use crate::utils::disk_used_by_path;
/// Every kind of mutation of the application is defined here.
/// It mutates `Status` or its children `Tab`.
pub struct EventExec {}
impl EventExec {
/// Reset the selected tab view to the default.
pub fn refresh_status(status: &mut Status) -> FmResult<()> {
status.refresh_users()?;
status.selected().refresh_view()
}
/// When a rezise event occurs, we may hide the second panel if the width
/// isn't sufficiant to display enough information.
/// We also need to know the new height of the terminal to start scrolling
/// up or down.