From 992ed12a7d8f410ff5f570d58dac9e028b632f7f Mon Sep 17 00:00:00 2001 From: Caleb Foust Date: Sun, 24 Dec 2023 08:28:07 -0800 Subject: [PATCH] fix: input/find location --- pkg/cy/api/input.go | 5 ++++- pkg/fuzzy/module.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/cy/api/input.go b/pkg/cy/api/input.go index 1a2026b7..bf738a86 100644 --- a/pkg/cy/api/input.go +++ b/pkg/cy/api/input.go @@ -65,7 +65,10 @@ func (i *InputModule) Find( ), fuzzy.WithResult(result), fuzzy.WithPrompt(params.Prompt), - fuzzy.WithInline(geom.Vec2{R: cursor.Y, C: cursor.X}), + fuzzy.WithInline( + geom.Vec2{R: cursor.Y, C: cursor.X}, + state.Image.Size(), + ), } if (params.Animated == nil || (*params.Animated) == true) && shouldAnimate { diff --git a/pkg/fuzzy/module.go b/pkg/fuzzy/module.go index d16ccbd1..141070ab 100644 --- a/pkg/fuzzy/module.go +++ b/pkg/fuzzy/module.go @@ -297,11 +297,11 @@ func WithResult(result chan<- interface{}) Setting { } // Displays Fuzzy as a small window at this location on the screen. -func WithInline(location geom.Vec2) Setting { +func WithInline(location, size geom.Vec2) Setting { return func(ctx context.Context, f *Fuzzy) { f.isInline = true f.location = location - f.isUp = f.location.R > (f.size.R / 2) + f.isUp = f.location.R > (size.R / 2) } }