summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-04-05 09:23:37 +0000
committerBlaž Hrastnik2021-04-05 09:23:37 +0000
commit95d0bba81ae8ed035399b2cb362d2f65481d4781 (patch)
treeaf8d35e7de2864abec5d4188bdb7a29fb2ef56c2 /helix-term/src/commands.rs
parent59a0fc7b59186b3bedb01dd5b958d3b97b9fbba2 (diff)
ui: Improve completion state handling.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 97078794..c3afbd92 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1691,8 +1691,12 @@ pub fn completion(cx: &mut Context) {
// TODO: if no completion, show some message or something
if !items.is_empty() {
- let completion = Completion::new(items, trigger_offset);
- compositor.push(Box::new(completion));
+ use crate::compositor::AnyComponent;
+ let size = compositor.size();
+ let ui = compositor.find("hx::ui::editor::EditorView").unwrap();
+ if let Some(ui) = ui.as_any_mut().downcast_mut::<ui::EditorView>() {
+ ui.set_completion(items, trigger_offset, size);
+ };
}
},
);