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/segment.rs | 65 ++-------------------------------------------------------- 1 file changed, 2 insertions(+), 63 deletions(-) (limited to 'src/segment.rs') diff --git a/src/segment.rs b/src/segment.rs index 0d71af1af..4e3a2c086 100644 --- a/src/segment.rs +++ b/src/segment.rs @@ -1,4 +1,4 @@ -use ansi_term::{ANSIString, ANSIStrings, Style}; +use ansi_term::{ANSIString, Style}; use std::fmt; /// A segment is a single configurable element in a module. This will usually @@ -11,14 +11,8 @@ pub struct Segment { /// The segment's style. If None, will inherit the style of the module containing it. style: Option