on master help sign in
fix: ui: Pin popups with no positioning to the initial cursor position

This avoids the floating popup following the cursor as we type.

commit12ea3888c59aec8e6d0b4dcf6a3ad92a84edaca7 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 19 Aug 2021, 11:25 (5 years ago) parent466528c
1 file changed+1−2
helix-term/src/ui/popup.rs+1−2
helix-term/src/ui/popup.rs+1−2
@@ -110,8 +110,7 @@ impl<T: Component> Component for Popup<T> {
110110
111111 let position = self
112112 .position
113− .or_else(|| cx.editor.cursor().0)
114− .unwrap_or_default();
113+ .get_or_insert_with(|| cx.editor.cursor().0.unwrap_or_default());
115114
116115 let (width, height) = self.size;
117116