From 065ef4d5a1f5443de5726343323403477b0263b5 Mon Sep 17 00:00:00 2001 From: Jeff Zhao Date: Thu, 29 Apr 2021 19:43:07 -0400 Subject: 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 --- src/context/context.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/context') 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 } -- cgit v1.2.3