diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-04-29 19:43:07 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-04-29 19:46:17 -0400 |
commit | 065ef4d5a1f5443de5726343323403477b0263b5 (patch) | |
tree | 5f9178bb33229b068c7e9b346d5b7e1c046b989b /src/context | |
parent | 10394fd7a2fb41e9eb6bea36e57b5270d50e5cbf (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/context')
-rw-r--r-- | src/context/context.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/context/context.rs b/src/context/context.rs index 09e9c56..add4c7e 100644 --- a/src/context/context.rs +++ b/src/context/context.rs @@ -3,13 +3,13 @@ use std::collections::VecDeque; use std::sync::mpsc; use std::thread; -use globset::GlobMatcher; - use crate::commands::SearchPattern; use crate::config; use crate::context::{LocalStateContext, TabContext}; use crate::io::{IoWorkerObserver, IoWorkerProgress, IoWorkerThread}; +use crate::util::display::DisplayOption; use crate::util::event::{Events, JoshutoEvent}; +use crate::util::sort; pub struct JoshutoContext { pub exit: bool, @@ -46,6 +46,22 @@ impl JoshutoContext { &mut self.config } + pub fn display_options_ref(&self) -> &DisplayOption { + self.config_ref().display_options_ref() + } + + pub fn display_options_mut(&mut self) -> &mut DisplayOption { + self.config_mut().display_options_mut() + } + + pub fn sort_options_ref(&self) -> &sort::SortOption { + self.config_ref().display_options_ref().sort_options_ref() + } + + pub fn sort_options_mut(&mut self) -> &mut sort::SortOption { + self.config_mut().display_options_mut().sort_options_mut() + } + pub fn tab_context_ref(&self) -> &TabContext { &self.tab_context } |