changed config-parser macro to check struct hirarchy when parsing
configuration file fixed formatting of stack and bookmarks
This commit is contained in:
+3
-1
@@ -114,8 +114,10 @@ impl Bookmarks {
|
||||
&config.format.bookmarks_separator,
|
||||
&config.styles.bookmarks_seperator_style,
|
||||
);
|
||||
|
||||
let mut path = apply_format(path.to_str().unwrap(), &config.styles.bookmarks_path_style);
|
||||
path = path.replace('/', &format!("{}/{}", config.styles.bookmarks_punct_style, RESET_SEQ));
|
||||
path = path.replace('/', &format!("{}/{}{}", config.styles.bookmarks_punct_style, RESET_SEQ, &config.styles.bookmarks_path_style));
|
||||
|
||||
if config.format.align_separators {
|
||||
buffer.push_str(&format!("{}{}{}{}\n", name, padding, separator, path));
|
||||
} else {
|
||||
|
||||
+3
-3
@@ -60,7 +60,7 @@ pub struct StyleSettings {
|
||||
#[default_value("default")]
|
||||
pub stack_path_style: String,
|
||||
#[style_config]
|
||||
#[default_value("magenta")]
|
||||
#[default_value("green")]
|
||||
pub stack_punct_style: String,
|
||||
#[style_config]
|
||||
#[default_value("default")]
|
||||
@@ -72,7 +72,7 @@ pub struct StyleSettings {
|
||||
#[default_value("default")]
|
||||
pub bookmarks_path_style: String,
|
||||
#[style_config]
|
||||
#[default_value("magenta")]
|
||||
#[default_value("green")]
|
||||
pub bookmarks_punct_style: String,
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ impl Config {
|
||||
|
||||
/// generates and populates a new instance of Config
|
||||
pub fn new(styles_as_ansi_sequences: bool) -> Result<Self> {
|
||||
let mut config = Self::default();
|
||||
let mut config: Config = Self::default();
|
||||
// get configuration directory
|
||||
let mut conf_file = match config_dir() {
|
||||
Some(value) => value,
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ impl Stack {
|
||||
&config.styles.stack_separator_style,
|
||||
);
|
||||
let mut path = apply_format(item.to_str().unwrap(), &config.styles.stack_path_style);
|
||||
path = path.replace('/', &format!("{}/{}", config.styles.stack_punct_style, RESET_SEQ));
|
||||
path = path.replace('/', &format!("{}/{}{}", config.styles.stack_punct_style, RESET_SEQ, config.styles.stack_path_style));
|
||||
if config.format.align_separators {
|
||||
buffer.push_str(&format!("{}{}{}{}\n", number, padding, separator, path));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user