summaryrefslogtreecommitdiffstats
path: root/src/commands/touch_file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/touch_file.rs')
-rw-r--r--src/commands/touch_file.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/commands/touch_file.rs b/src/commands/touch_file.rs
index 19728db..e3b3a59 100644
--- a/src/commands/touch_file.rs
+++ b/src/commands/touch_file.rs
@@ -19,6 +19,7 @@ fn _create_file(file: &path::Path) -> std::io::Result<()> {
}
pub fn touch_file(context: &mut AppContext, arg: &str) -> JoshutoResult {
+ let curr_tab = context.tab_context_ref().curr_tab_ref();
match arg {
"" => {
if let Some(selected_file_path) = context
@@ -41,17 +42,20 @@ pub fn touch_file(context: &mut AppContext, arg: &str) -> JoshutoResult {
}
}
- let path = context
- .tab_context_ref()
- .curr_tab_ref()
+ let path = curr_tab
.curr_list_ref()
.map(|lst| lst.file_path().to_path_buf());
if let Some(path) = path {
let options = context.config_ref().display_options_ref().clone();
-
+ let tab_options = context
+ .tab_context_ref()
+ .curr_tab_ref()
+ .option_ref()
+ .clone();
let history = context.tab_context_mut().curr_tab_mut().history_mut();
- let new_dirlist = create_dirlist_with_history(history, path.as_path(), &options)?;
+ let new_dirlist =
+ create_dirlist_with_history(history, path.as_path(), &options, &tab_options)?;
history.insert(path, new_dirlist);
}
Ok(())