From 097f1b05f1d82967fe2a900ccf7ba3597c04ad77 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Mon, 10 Jun 2019 15:56:17 +0100 Subject: Add support for prompt configuration (#62) - Create `Config` struct that is added to `Context` when initialized - Read `~/.confg/starship.toml` during initialization (can be updated later to also look at `$XDG_CONFIG_HOME`) - `Context` now has a method for creating modules. This allows us to provide modules with a reference to the configuration specific to that module --- src/modules/line_break.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/line_break.rs') diff --git a/src/modules/line_break.rs b/src/modules/line_break.rs index 223695dcf..0b11367ec 100644 --- a/src/modules/line_break.rs +++ b/src/modules/line_break.rs @@ -1,10 +1,10 @@ use super::{Context, Module}; /// Creates a segment for the line break -pub fn segment(_context: &Context) -> Option { +pub fn segment<'a>(context: &'a Context) -> Option> { const LINE_ENDING: &str = "\n"; - let mut module = Module::new("line_break"); + let mut module = context.new_module("line_break"); module.get_prefix().set_value(""); module.get_suffix().set_value(""); -- cgit v1.2.3