Skip to content

Commit

Permalink
fix: input/find location
Browse files Browse the repository at this point in the history
  • Loading branch information
cfoust committed Dec 24, 2023
1 parent 704dec2 commit 992ed12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pkg/cy/api/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/fuzzy/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 992ed12

Please sign in to comment.