diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-11-01 20:50:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-01 20:50:32 +0000 |
commit | a3f729f5899a1d56222641f362805f251de3f84d (patch) | |
tree | 4abb9ad7a5372780fe0b429a203ab1b1e20972f7 | |
parent | a846faa6ef28b105d921ccbdabcf2cb201fe7c94 (diff) | |
download | alacritty-a3f729f5899a1d56222641f362805f251de3f84d.tar.gz alacritty-a3f729f5899a1d56222641f362805f251de3f84d.zip |
Fix default hollow cursor behavior with empty conf
The 2c37da48b580237ff48f5e841015134dd459b41d change introduced some
changes to the way cursor configuration is handled. However it did not
properly handle the default behavior of the hollow cursor when the
`cursor` field was not specified at all.
By implementing the `Default` trait for the `Cursor` struct in
`config.rs` manually, the default value of the `unfocused_hollow` field
has been corrected back to `true` when the `cursor` struct isn't present
at all.
-rw-r--r-- | src/config.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index ae26f76e..5e30b65a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1206,7 +1206,7 @@ fn deserialize_color_index<'a, D>(deserializer: D) -> ::std::result::Result<u8, } } -#[derive(Copy, Clone, Debug, Default, Deserialize)] +#[derive(Copy, Clone, Debug, Deserialize)] pub struct Cursor { #[serde(default, deserialize_with = "failure_default")] pub style: CursorStyle, @@ -1214,6 +1214,15 @@ pub struct Cursor { pub unfocused_hollow: bool, } +impl Default for Cursor { + fn default() -> Self { + Self { + style: Default::default(), + unfocused_hollow: true, + } + } +} + #[derive(Debug, Copy, Clone, Default, Deserialize)] pub struct CursorColors { #[serde(default, deserialize_with = "deserialize_optional_color")] |