mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 04:09:37 +00:00
Fix markdown preview heading overflows no wrap (#8052)
![Kapture 2024-02-20 at 18 27 15](https://github.com/zed-industries/zed/assets/8416130/87d4dcea-e2f0-44ba-88a4-06829dbb0e89) Release Notes: - Improved markdown preview wrapping ([#8047](https://github.com/zed-industries/zed/issues/8047)).
This commit is contained in:
parent
c54d6aff6c
commit
6c714c13b3
1 changed files with 6 additions and 2 deletions
|
@ -8,7 +8,10 @@ use gpui::{
|
||||||
HighlightStyle, Hsla, InteractiveText, IntoElement, ParentElement, SharedString, Styled,
|
HighlightStyle, Hsla, InteractiveText, IntoElement, ParentElement, SharedString, Styled,
|
||||||
StyledText, TextStyle, WeakView, WindowContext,
|
StyledText, TextStyle, WeakView, WindowContext,
|
||||||
};
|
};
|
||||||
use std::{ops::Range, sync::Arc};
|
use std::{
|
||||||
|
ops::{Mul, Range},
|
||||||
|
sync::Arc,
|
||||||
|
};
|
||||||
use theme::{ActiveTheme, SyntaxTheme};
|
use theme::{ActiveTheme, SyntaxTheme};
|
||||||
use ui::{h_flex, v_flex, Label};
|
use ui::{h_flex, v_flex, Label};
|
||||||
use workspace::Workspace;
|
use workspace::Workspace;
|
||||||
|
@ -115,7 +118,7 @@ fn render_markdown_heading(parsed: &ParsedMarkdownHeading, cx: &mut RenderContex
|
||||||
_ => cx.text_color,
|
_ => cx.text_color,
|
||||||
};
|
};
|
||||||
|
|
||||||
let line_height = DefiniteLength::from(rems(1.25));
|
let line_height = DefiniteLength::from(size.mul(1.25));
|
||||||
|
|
||||||
div()
|
div()
|
||||||
.line_height(line_height)
|
.line_height(line_height)
|
||||||
|
@ -124,6 +127,7 @@ fn render_markdown_heading(parsed: &ParsedMarkdownHeading, cx: &mut RenderContex
|
||||||
.pt(rems(0.15))
|
.pt(rems(0.15))
|
||||||
.pb_1()
|
.pb_1()
|
||||||
.child(render_markdown_text(&parsed.contents, cx))
|
.child(render_markdown_text(&parsed.contents, cx))
|
||||||
|
.whitespace_normal()
|
||||||
.into_any()
|
.into_any()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue