summaryrefslogtreecommitdiffstats
path: root/src/commands/sort.rs
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-04-29 19:43:07 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-04-29 19:46:17 -0400
commit065ef4d5a1f5443de5726343323403477b0263b5 (patch)
tree5f9178bb33229b068c7e9b346d5b7e1c046b989b /src/commands/sort.rs
parent10394fd7a2fb41e9eb6bea36e57b5270d50e5cbf (diff)
rework config structure
- sort options is now nested under display options which holds a lot of previously general options - fix glob search not searching backwards
Diffstat (limited to 'src/commands/sort.rs')
-rw-r--r--src/commands/sort.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/commands/sort.rs b/src/commands/sort.rs
index dff0fd3..ab255f3 100644
--- a/src/commands/sort.rs
+++ b/src/commands/sort.rs
@@ -8,17 +8,19 @@ use crate::util::sort::SortType;
use super::reload;
pub fn set_sort(context: &mut JoshutoContext, method: SortType) -> JoshutoResult<()> {
- context.config_mut().sort_option.sort_method = method;
+ context.sort_options_mut().sort_method = method;
+
for tab in context.tab_context_mut().iter_mut() {
tab.history_mut().depreciate_all_entries();
}
+
reload::soft_reload(context.tab_context_ref().get_index(), context)?;
LoadChild::load_child(context)?;
Ok(())
}
pub fn toggle_reverse(context: &mut JoshutoContext) -> JoshutoResult<()> {
- context.config_mut().sort_option.reverse = !context.config_ref().sort_option.reverse;
+ context.sort_options_mut().reverse = !context.sort_options_ref().reverse;
for tab in context.tab_context_mut().iter_mut() {
tab.history_mut().depreciate_all_entries();
}