aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/completion.rs
diff options
context:
space:
mode:
authorCossonLeo2022-01-24 01:41:25 +0000
committerGitHub2022-01-24 01:41:25 +0000
commitd49e5323f9230f3195d3ee4c5e682cd6d8c2cb1a (patch)
tree80a968f78ca3c9cd0bc88f0c1a27f4b4107a8b2b /helix-term/src/ui/completion.rs
parent4044c70eb2d23402629d58d0e8904815abd68dc7 (diff)
Use markup scopes for the Markdown component (#1363)
Diffstat (limited to 'helix-term/src/ui/completion.rs')
-rw-r--r--helix-term/src/ui/completion.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs
index c9ed3b4a..35afe81e 100644
--- a/helix-term/src/ui/completion.rs
+++ b/helix-term/src/ui/completion.rs
@@ -304,6 +304,9 @@ impl Component for Completion {
let cursor_pos = doc.selection(view.id).primary().cursor(text);
let coords = helix_core::visual_coords_at_pos(text, cursor_pos, doc.tab_width());
let cursor_pos = (coords.row - view.offset.row) as u16;
+
+ let markdown_ui =
+ |content, syn_loader| Markdown::new(content, syn_loader).style_group("completion");
let mut markdown_doc = match &option.documentation {
Some(lsp::Documentation::String(contents))
| Some(lsp::Documentation::MarkupContent(lsp::MarkupContent {
@@ -311,7 +314,7 @@ impl Component for Completion {
value: contents,
})) => {
// TODO: convert to wrapped text
- Markdown::new(
+ markdown_ui(
format!(
"```{}\n{}\n```\n{}",
language,
@@ -326,7 +329,7 @@ impl Component for Completion {
value: contents,
})) => {
// TODO: set language based on doc scope
- Markdown::new(
+ markdown_ui(
format!(
"```{}\n{}\n```\n{}",
language,
@@ -340,7 +343,7 @@ impl Component for Completion {
// TODO: copied from above
// TODO: set language based on doc scope
- Markdown::new(
+ markdown_ui(
format!(
"```{}\n{}\n```",
language,