From 12ea3888c59aec8e6d0b4dcf6a3ad92a84edaca7 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 19 Aug 2021 11:25:19 +0900 Subject: 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(-) (limited to 'helix-term') 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; -- cgit v1.2.3-70-g09d2