Skip to repository content23 lines · 731 B · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T05:39:47.657Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
markdown_preview_settings.rs
1use gpui::{Pixels, px};
2use settings::{RegisterSetting, Settings};
3
4/// The settings for the markdown preview.
5#[derive(Clone, Copy, Debug, Default, RegisterSetting)]
6pub struct MarkdownPreviewSettings {
7 /// The maximum width of the rendered markdown content, or `None` to render
8 /// content edge to edge.
9 pub max_width: Option<Pixels>,
10}
11
12impl Settings for MarkdownPreviewSettings {
13 fn from_settings(content: &settings::SettingsContent) -> Self {
14 let content = content.markdown_preview.clone().unwrap_or_default();
15 let max_width = if content.limit_content_width.unwrap_or(true) {
16 content.max_width.map(px)
17 } else {
18 None
19 };
20 Self { max_width }
21 }
22}
23