mirror of
https://github.com/charmbracelet/gum.git
synced 2024-08-17 02:00:46 +03:00
Add newline printing to --select-if-one (#459)
* 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.
This commit is contained in:
parent
c9afacc74b
commit
d1145b4163
@ -35,6 +35,7 @@ func (o Options) Run() error {
|
||||
|
||||
if o.SelectIfOne && len(o.Options) == 1 {
|
||||
print(o.Options[0])
|
||||
print("\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ func (o Options) Run() error {
|
||||
} else {
|
||||
fmt.Print(ansi.Strip(o.Options[0]))
|
||||
}
|
||||
print("\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user