From 29c053e84e2624feb786f520ebae4c752bc23279 Mon Sep 17 00:00:00 2001 From: Kirawi Date: Wed, 8 Dec 2021 02:11:18 -0500 Subject: Only use a single documentation popup (#1241) --- helix-term/src/commands.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'helix-term/src/commands.rs') 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)); + } } }, ); -- cgit v1.2.3-70-g09d2