summaryrefslogtreecommitdiffstats
path: root/src/commands/flat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/flat.rs')
-rw-r--r--src/commands/flat.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/commands/flat.rs b/src/commands/flat.rs
index 632b321..c0e9dfb 100644
--- a/src/commands/flat.rs
+++ b/src/commands/flat.rs
@@ -48,6 +48,11 @@ pub fn flatten(depth: usize, context: &mut AppContext) -> JoshutoResult {
let path = context.tab_context_ref().curr_tab_ref().cwd().to_path_buf();
let options = context.config_ref().display_options_ref().clone();
+ let tab_options = context
+ .tab_context_ref()
+ .curr_tab_ref()
+ .option_ref()
+ .clone();
let mut index: Option<usize> = context
.tab_context_ref()
@@ -69,7 +74,8 @@ pub fn flatten(depth: usize, context: &mut AppContext) -> JoshutoResult {
index = None;
}
- let sort_options = options.sort_options_ref();
+ let sort_options = tab_options.sort_options_ref();
+
contents.sort_by(|f1, f2| sort_options.compare(f1, f2));
let metadata = JoshutoMetadata::from(path.as_path())?;