mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Fix scrolling and wrapping in the markdown preview renderer (#7234)
Release Notes: - N/A
This commit is contained in:
parent
97be0a930c
commit
d4264cbe4e
@ -114,13 +114,16 @@ impl Render for MarkdownPreviewView {
|
||||
.key_context("MarkdownPreview")
|
||||
.track_focus(&self.focus_handle)
|
||||
.id("MarkdownPreview")
|
||||
.overflow_scroll()
|
||||
.overflow_y_scroll()
|
||||
.overflow_x_hidden()
|
||||
.size_full()
|
||||
.bg(cx.theme().colors().editor_background)
|
||||
.p_4()
|
||||
.children(render_markdown(&self.contents, &self.languages, cx));
|
||||
|
||||
div().flex_1().child(
|
||||
// FIXME: This shouldn't be necessary
|
||||
// but the overflow_scroll above doesn't seem to work without it
|
||||
canvas(move |bounds, cx| {
|
||||
rendered_markdown.into_any().draw(
|
||||
bounds.origin,
|
||||
|
@ -174,7 +174,7 @@ where
|
||||
}
|
||||
|
||||
let element = self.render_md_from_range(source_range.clone(), cx);
|
||||
let paragraph = h_flex().mb_3().child(element);
|
||||
let paragraph = div().mb_3().child(element);
|
||||
|
||||
self.finished.push(paragraph);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user