mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
Only write newlines in menu selection popup if the lsp returns detail (#4902)
This commit is contained in:
parent
d914642089
commit
6798a6651f
@ -411,7 +411,7 @@ fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
|
|||||||
"```{}\n{}\n```\n{}",
|
"```{}\n{}\n```\n{}",
|
||||||
language,
|
language,
|
||||||
option.detail.as_deref().unwrap_or_default(),
|
option.detail.as_deref().unwrap_or_default(),
|
||||||
contents.clone()
|
contents
|
||||||
),
|
),
|
||||||
cx.editor.syn_loader.clone(),
|
cx.editor.syn_loader.clone(),
|
||||||
)
|
)
|
||||||
@ -421,15 +421,14 @@ fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
|
|||||||
value: contents,
|
value: contents,
|
||||||
})) => {
|
})) => {
|
||||||
// TODO: set language based on doc scope
|
// TODO: set language based on doc scope
|
||||||
|
if let Some(detail) = &option.detail.as_deref() {
|
||||||
Markdown::new(
|
Markdown::new(
|
||||||
format!(
|
format!("```{}\n{}\n```\n{}", language, detail, contents),
|
||||||
"```{}\n{}\n```\n{}",
|
|
||||||
language,
|
|
||||||
option.detail.as_deref().unwrap_or_default(),
|
|
||||||
contents.clone()
|
|
||||||
),
|
|
||||||
cx.editor.syn_loader.clone(),
|
cx.editor.syn_loader.clone(),
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
Markdown::new(contents.to_string(), cx.editor.syn_loader.clone())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None if option.detail.is_some() => {
|
None if option.detail.is_some() => {
|
||||||
// TODO: copied from above
|
// TODO: copied from above
|
||||||
|
Loading…
Reference in New Issue
Block a user