aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-03-30 16:22:51 +0000
committerBlaž Hrastnik2023-03-31 06:19:28 +0000
commit7a69c40524833f93c3df32ba457a1a658472bb4b (patch)
tree6bfa45e39db0f195abed2e51e4335f8cdc69ecbc /helix-term/src/commands.rs
parentab819d80f1391667f8ff6b149fa4fbe977f4607a (diff)
Hide signature help if it overlays completion menu (#5523)
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 0f53fdc9..b55f1ab7 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -54,8 +54,8 @@ use crate::{
job::Callback,
keymap::ReverseKeymap,
ui::{
- self, editor::InsertEvent, overlay::overlayed, FilePicker, Picker, Popup, Prompt,
- PromptEvent,
+ self, editor::InsertEvent, lsp::SignatureHelp, overlay::overlayed, FilePicker, Picker,
+ Popup, Prompt, PromptEvent,
},
};
@@ -4261,7 +4261,7 @@ pub fn completion(cx: &mut Context) {
}
let size = compositor.size();
let ui = compositor.find::<ui::EditorView>().unwrap();
- ui.set_completion(
+ let completion_area = ui.set_completion(
editor,
savepoint,
items,
@@ -4270,6 +4270,15 @@ pub fn completion(cx: &mut Context) {
trigger_offset,
size,
);
+ let size = compositor.size();
+ let signature_help_area = compositor
+ .find_id::<Popup<SignatureHelp>>(SignatureHelp::ID)
+ .map(|signature_help| signature_help.area(size, editor));
+ // Delete the signature help popup if they intersect.
+ if matches!((completion_area, signature_help_area),(Some(a), Some(b)) if a.intersects(b))
+ {
+ compositor.remove(SignatureHelp::ID);
+ }
},
);
}