mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
Add external_edit_file_suffix
to config (#253)
This commit is contained in:
parent
e5b284ed19
commit
b995906c79
5 changed files with 18 additions and 2 deletions
|
@ -507,6 +507,7 @@ pub struct TunableValues {
|
|||
pub notifications: Notifications,
|
||||
pub image_preview: Option<ImagePreviewValues>,
|
||||
pub user_gutter_width: usize,
|
||||
pub external_edit_file_suffix: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Deserialize)]
|
||||
|
@ -530,6 +531,7 @@ pub struct Tunables {
|
|||
pub notifications: Option<Notifications>,
|
||||
pub image_preview: Option<ImagePreview>,
|
||||
pub user_gutter_width: Option<usize>,
|
||||
pub external_edit_file_suffix: Option<String>,
|
||||
}
|
||||
|
||||
impl Tunables {
|
||||
|
@ -557,6 +559,9 @@ impl Tunables {
|
|||
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),
|
||||
external_edit_file_suffix: self
|
||||
.external_edit_file_suffix
|
||||
.or(other.external_edit_file_suffix),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -580,6 +585,9 @@ impl Tunables {
|
|||
notifications: self.notifications.unwrap_or_default(),
|
||||
image_preview: self.image_preview.map(ImagePreview::values),
|
||||
user_gutter_width: self.user_gutter_width.unwrap_or(30),
|
||||
external_edit_file_suffix: self
|
||||
.external_edit_file_suffix
|
||||
.unwrap_or_else(|| ".md".to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue