aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorKirawi2021-12-08 07:11:18 +0000
committerGitHub2021-12-08 07:11:18 +0000
commit29c053e84e2624feb786f520ebae4c752bc23279 (patch)
treed537982f3f7304142a84b0affacc5f830bca105c /helix-term/src/commands.rs
parentd08bdfa838098769afc59146b62f9d613d4a7ff4 (diff)
Only use a single documentation popup (#1241)
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 4910790a..1f7a2275 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -5130,8 +5130,12 @@ fn hover(cx: &mut Context) {
// skip if contents empty
let contents = ui::Markdown::new(contents, editor.syn_loader.clone());
- let popup = Popup::new(contents);
- compositor.push(Box::new(popup));
+ let popup = Popup::new("documentation", contents);
+ if let Some(doc_popup) = compositor.find_id("documentation") {
+ *doc_popup = popup;
+ } else {
+ compositor.push(Box::new(popup));
+ }
}
},
);