diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-08-21 15:48:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 18:48:48 +0300 |
commit | 3c3e6870dedad56b270f5b65ea57d5a6e46b1de6 (patch) | |
tree | 84a4e306a1c198f1bb81a090cb41f7b062e3f736 /alacritty/src/config/ui_config.rs | |
parent | 3a7130086a8b5fa95c46a15d5b09a220be57708c (diff) | |
download | r-alacritty-3c3e6870dedad56b270f5b65ea57d5a6e46b1de6.tar.gz r-alacritty-3c3e6870dedad56b270f5b65ea57d5a6e46b1de6.tar.bz2 r-alacritty-3c3e6870dedad56b270f5b65ea57d5a6e46b1de6.zip |
Add configuration file imports
This adds the ability for users to have multiple configuration files
which all inherit from each other.
The order of imports is chronological, branching out to the deepest
children first and overriding every field with that of the configuration
files that are loaded at a later point in time.
Live config reload watches the directories of all configuration files,
allowing edits in any of them to update Alacritty immediately. While the
imports are live reloaded, a new configuration file watcher will only be
spawned once Alacritty is restarted.
Since this might cause loops which would be very difficult to detect, a
maximum depth is set to limit the recursion possible with nested
configuration files.
Fixes #779.
Diffstat (limited to 'alacritty/src/config/ui_config.rs')
-rw-r--r-- | alacritty/src/config/ui_config.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index a8b1749f..31654c6c 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use log::error; use serde::{Deserialize, Deserializer}; @@ -46,6 +48,10 @@ pub struct UIConfig { #[serde(default, deserialize_with = "failure_default")] background_opacity: Percentage, + /// Path where config was loaded from. + #[serde(skip)] + pub config_paths: Vec<PathBuf>, + // TODO: DEPRECATED #[serde(default, deserialize_with = "failure_default")] pub dynamic_title: Option<bool>, @@ -64,6 +70,7 @@ impl Default for UIConfig { background_opacity: Default::default(), live_config_reload: Default::default(), dynamic_title: Default::default(), + config_paths: Default::default(), } } } |