Skip to content

Commit

Permalink
fix: ui: Pin popups with no positioning to the initial cursor position
Browse files Browse the repository at this point in the history
This avoids the floating popup following the cursor as we type.
  • Loading branch information
archseer committed Aug 19, 2021
1 parent 466528c commit 12ea388
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions helix-term/src/ui/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ impl<T: Component> Component for Popup<T> {

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;

Expand Down

0 comments on commit 12ea388

Please sign in to comment.