Skip to content

Commit

Permalink
Add newline printing to --select-if-one (#459)
Browse files Browse the repository at this point in the history
* Add newline printing to --select-if-one

This matches how choose works normally when there are more than
one option.

* Add newline printing to filter --select-if-one

To match how it works without --select-if-one.
  • Loading branch information
snan authored Dec 7, 2023
1 parent c9afacc commit d1145b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions choose/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (o Options) Run() error {

if o.SelectIfOne && len(o.Options) == 1 {
print(o.Options[0])
print("\n")
return nil
}

Expand Down
1 change: 1 addition & 0 deletions filter/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (o Options) Run() error {
} else {
fmt.Print(ansi.Strip(o.Options[0]))
}
print("\n")
return nil
}

Expand Down

0 comments on commit d1145b4

Please sign in to comment.