1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -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:
Christian Duerr 2024-01-14 17:25:15 +01:00
parent 9458550c77
commit 172a2882cd
2 changed files with 10 additions and 1 deletions

View file

@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- CLI env variables clearing configuration file variables
- Vi inline search/semantic selection expanding across newlines
## 0.13.1

View file

@ -61,7 +61,15 @@ impl<'de, T: SerdeReplace + Deserialize<'de>> SerdeReplace for Option<T> {
impl<'de, T: Deserialize<'de>> SerdeReplace for HashMap<String, T> {
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(())
}
}