summaryrefslogtreecommitdiffstats
path: root/src/context
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-12-15 11:48:20 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-12-15 11:48:20 -0500
commit12eb9eed1aeb4f3045b78dd19ae20d07bfea7de9 (patch)
treea2204b1fbef5f1ed93312f94196ded9a5a8c6ec5 /src/context
parentf5902708a6e597064482edfc076248a67882b7c5 (diff)
add option to not collapse preview
- add methods to access config_t - add back home dir path shortening option
Diffstat (limited to 'src/context')
-rw-r--r--src/context/context.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/context/context.rs b/src/context/context.rs
index 520f77c..95c9d1d 100644
--- a/src/context/context.rs
+++ b/src/context/context.rs
@@ -10,7 +10,7 @@ use crate::util::event::{Event, Events};
pub struct JoshutoContext {
pub exit: bool,
- pub config_t: config::JoshutoConfig,
+ config: config::JoshutoConfig,
events: Events,
tab_context: TabContext,
local_state: Option<LocalStateContext>,
@@ -21,7 +21,7 @@ pub struct JoshutoContext {
}
impl JoshutoContext {
- pub fn new(config_t: config::JoshutoConfig) -> Self {
+ pub fn new(config: config::JoshutoConfig) -> Self {
Self {
exit: false,
events: Events::new(),
@@ -31,10 +31,18 @@ impl JoshutoContext {
message_queue: VecDeque::with_capacity(4),
worker_queue: VecDeque::new(),
worker: None,
- config_t,
+ config,
}
}
+ pub fn config_ref(&self) -> &config::JoshutoConfig {
+ &self.config
+ }
+
+ pub fn config_mut(&mut self) -> &mut config::JoshutoConfig {
+ &mut self.config
+ }
+
pub fn tab_context_ref(&self) -> &TabContext {
&self.tab_context
}