From 12ea3888c59aec8e6d0b4dcf6a3ad92a84edaca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 19 Aug 2021 11:25:19 +0900 Subject: [PATCH] fix: ui: Pin popups with no positioning to the initial cursor position This avoids the floating popup following the cursor as we type. --- helix-term/src/ui/popup.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/helix-term/src/ui/popup.rs b/helix-term/src/ui/popup.rs index e31d4d7b..e126c845 100644 --- a/helix-term/src/ui/popup.rs +++ b/helix-term/src/ui/popup.rs @@ -110,8 +110,7 @@ impl Component for Popup { let position = self .position - .or_else(|| cx.editor.cursor().0) - .unwrap_or_default(); + .get_or_insert_with(|| cx.editor.cursor().0.unwrap_or_default()); let (width, height) = self.size;