diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2024-03-15 18:50:19 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2024-03-15 18:50:19 -0400 |
commit | 0dd87e2ec4385adb97a33e2b595fa8d674f46ae5 (patch) | |
tree | 4587c3d9f75881f97b166cc7a17241fdf7f4c08f /src/commands/sort.rs | |
parent | cbb062d15b5d2a03f2872063f0af0c560d47db0b (diff) | |
parent | 2536838ce31955ec55561aabb4b86fdd4bc984df (diff) |
Merge branch 'main' of github.com:kamiyaa/joshuto
Diffstat (limited to 'src/commands/sort.rs')
-rw-r--r-- | src/commands/sort.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/commands/sort.rs b/src/commands/sort.rs index 7bea48f..fa597c1 100644 --- a/src/commands/sort.rs +++ b/src/commands/sort.rs @@ -5,13 +5,18 @@ use crate::history::DirectoryHistory; use super::reload; -pub fn set_sort(context: &mut AppContext, method: SortType) -> AppResult { +pub fn set_sort(context: &mut AppContext, method: SortType, reverse: Option<bool>) -> AppResult { let curr_tab = context.tab_context_mut().curr_tab_mut(); curr_tab .option_mut() .sort_options_mut() .set_sort_method(method); curr_tab.history_mut().depreciate_all_entries(); + + if let Some(r) = reverse { + curr_tab.option_mut().sort_options_mut().reverse = r; + } + refresh(context) } |