Support configuring user gutter width (#223)

This commit is contained in:
mordquist 2024-03-24 02:54:26 +01:00 committed by GitHub
parent 23a729e565
commit 46e081b1e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 18 deletions

View file

@ -485,6 +485,7 @@ pub struct TunableValues {
pub open_command: Option<Vec<String>>,
pub notifications: Notifications,
pub image_preview: Option<ImagePreviewValues>,
pub user_gutter_width: usize,
}
#[derive(Clone, Default, Deserialize)]
@ -507,6 +508,7 @@ pub struct Tunables {
pub open_command: Option<Vec<String>>,
pub notifications: Option<Notifications>,
pub image_preview: Option<ImagePreview>,
pub user_gutter_width: Option<usize>,
}
impl Tunables {
@ -533,6 +535,7 @@ impl Tunables {
open_command: self.open_command.or(other.open_command),
notifications: self.notifications.or(other.notifications),
image_preview: self.image_preview.or(other.image_preview),
user_gutter_width: self.user_gutter_width.or(other.user_gutter_width),
}
}
@ -555,6 +558,7 @@ impl Tunables {
open_command: self.open_command,
notifications: self.notifications.unwrap_or_default(),
image_preview: self.image_preview.map(ImagePreview::values),
user_gutter_width: self.user_gutter_width.unwrap_or(30),
}
}
}