Use early return in rendering completion doc

pull/5914/head
Gokul Soumya 2023-02-06 02:57:40 +05:30 committed by Blaž Hrastnik
parent 93c7afc4ed
commit 8e9c329952
1 changed files with 92 additions and 90 deletions

View File

@ -381,7 +381,10 @@ impl Component for Completion {
self.popup.render(area, surface, cx);
// if we have a selection, render a markdown popup on top/below with info
if let Some(option) = self.popup.contents().selection() {
let option = match self.popup.contents().selection() {
Some(option) => option,
None => return,
};
// need to render:
// option.detail
// ---
@ -481,4 +484,3 @@ impl Component for Completion {
markdown_doc.render(area, surface, cx);
}
}
}