mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
Fix env variable overrides through CLI
This fixes an issue where all CLI environment variables would replace existing configuration file variables instead of merging the two maps together. Fixes #7618.
This commit is contained in:
parent
b82a49ce0c
commit
94ede16ee4
2 changed files with 10 additions and 1 deletions
|
@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- CLI env variables clearing configuration file variables
|
||||||
- Vi inline search/semantic selection expanding across newlines
|
- Vi inline search/semantic selection expanding across newlines
|
||||||
|
|
||||||
## 0.13.1
|
## 0.13.1
|
||||||
|
|
|
@ -61,7 +61,15 @@ impl<'de, T: SerdeReplace + Deserialize<'de>> SerdeReplace for Option<T> {
|
||||||
|
|
||||||
impl<'de, T: Deserialize<'de>> SerdeReplace for HashMap<String, T> {
|
impl<'de, T: Deserialize<'de>> SerdeReplace for HashMap<String, T> {
|
||||||
fn replace(&mut self, value: Value) -> Result<(), Box<dyn Error>> {
|
fn replace(&mut self, value: Value) -> Result<(), Box<dyn Error>> {
|
||||||
replace_simple(self, value)
|
// Deserialize replacement as HashMap.
|
||||||
|
let hashmap: HashMap<String, T> = Self::deserialize(value)?;
|
||||||
|
|
||||||
|
// Merge the two HashMaps, replacing existing values.
|
||||||
|
for (key, value) in hashmap {
|
||||||
|
self.insert(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue