settings ui: Fix panic from reading BufferLineHeight custom variant (#39631)
The panic happened when a user had a settings file with a buffer line height custom variant, because the drop-down renderer only took into account the two named variants. The fix for this will be creating a custom element that allows a user to manually input a line height greater than one or select either Comfortable or Standard. Release Notes: - N/A
This commit is contained in:
@@ -262,18 +262,7 @@ impl From<FontFamilyName> for String {
|
||||
}
|
||||
|
||||
/// The buffer's line height.
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
PartialEq,
|
||||
JsonSchema,
|
||||
MergeFrom,
|
||||
Default,
|
||||
strum::VariantNames,
|
||||
)]
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, JsonSchema, MergeFrom, Default)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum BufferLineHeight {
|
||||
/// A less dense line height.
|
||||
@@ -285,10 +274,6 @@ pub enum BufferLineHeight {
|
||||
Custom(#[serde(deserialize_with = "deserialize_line_height")] f32),
|
||||
}
|
||||
|
||||
impl strum::VariantArray for BufferLineHeight {
|
||||
const VARIANTS: &'static [Self] = &[Self::Comfortable, Self::Standard];
|
||||
}
|
||||
|
||||
fn deserialize_line_height<'de, D>(deserializer: D) -> Result<f32, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
|
||||
Reference in New Issue
Block a user