Fix default hollow cursor behavior with empty conf
The 2c37da48b5
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.
This commit is contained in:
parent
a846faa6ef
commit
a3f729f589
|
@ -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 {
|
pub struct Cursor {
|
||||||
#[serde(default, deserialize_with = "failure_default")]
|
#[serde(default, deserialize_with = "failure_default")]
|
||||||
pub style: CursorStyle,
|
pub style: CursorStyle,
|
||||||
|
@ -1214,6 +1214,15 @@ pub struct Cursor {
|
||||||
pub unfocused_hollow: bool,
|
pub unfocused_hollow: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Cursor {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
style: Default::default(),
|
||||||
|
unfocused_hollow: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Default, Deserialize)]
|
#[derive(Debug, Copy, Clone, Default, Deserialize)]
|
||||||
pub struct CursorColors {
|
pub struct CursorColors {
|
||||||
#[serde(default, deserialize_with = "deserialize_optional_color")]
|
#[serde(default, deserialize_with = "deserialize_optional_color")]
|
||||||
|
|
Loading…
Reference in New Issue