mirror of
https://github.com/charmbracelet/gum
synced 2024-05-18 06:06:43 +02: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 {
|
if o.SelectIfOne && len(o.Options) == 1 {
|
||||||
print(o.Options[0])
|
print(o.Options[0])
|
||||||
|
print("\n")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ func (o Options) Run() error {
|
||||||
} else {
|
} else {
|
||||||
fmt.Print(ansi.Strip(o.Options[0]))
|
fmt.Print(ansi.Strip(o.Options[0]))
|
||||||
}
|
}
|
||||||
|
print("\n")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue