Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make completion docs scrollable

Juliaca88717f0c31
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 2035bd35f01..2f02ac59b06 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -1064,18 +1064,22 @@ impl CompletionsMenu {
.languages()
.clone();
let language = self.buffer.read(cx).language().map(Arc::clone);
+
+ enum CompletionDocsMarkdown {}
Some(
- crate::markdown::render_markdown(
- &content.value,
- &registry,
- &language,
- &style,
- cx,
- )
- .constrained()
- .with_width(alongside_docs_width)
- .contained()
- .with_style(alongside_docs_container_style),
+ Flex::column()
+ .scrollable::<CompletionDocsMarkdown>(0, None, cx)
+ .with_child(crate::markdown::render_markdown(
+ &content.value,
+ &registry,
+ &language,
+ &style,
+ cx,
+ ))
+ .constrained()
+ .with_width(alongside_docs_width)
+ .contained()
+ .with_style(alongside_docs_container_style),
)
} else {
None