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:
Anthony Eid
2025-10-06 20:39:05 +00:00
committed by GitHub
parent b2f0b1b168
commit 4e932297a4
3 changed files with 17 additions and 30 deletions
+1 -16
View File
@@ -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>,