Releases: fzdwx/infinite
Releases · fzdwx/infinite
v0.12.1
v0.12.0
Full Changelog: v0.11.2...v0.12.0
Selection
break changes :
- remove
PageSize
field, addSetPageSize
func on 132864d - Change the logic of page turning, previously it was scrolling, now it is forced paging on ed0facb
func main() {
options := []string{
"1 Buy carrots",
"2 Buy celery",
"3 Buy kohlrabi",
"4 Buy computer",
"5 Buy something",
"6 Buy car",
"7 Buy subway",
}
selectKeymap := singleselect.DefaultSingleKeyMap()
selectKeymap.Confirm = key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "finish select"),
)
selectKeymap.Choice = key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "finish select"),
)
selectKeymap.NextPage = key.NewBinding(
key.WithKeys("right"),
key.WithHelp("->", "next page"),
)
selectKeymap.PrevPage = key.NewBinding(
key.WithKeys("left"),
key.WithHelp("<-", "prev page"),
)
selected, err := inf.NewSingleSelect(
options,
singleselect.WithDisableFilter(),
singleselect.WithKeyBinding(selectKeymap),
singleselect.WithPageSize(5),
).Display("Hello world")
if err == nil {
fmt.Printf("you selection %s\n", options[selected])
}
}
Input confirm
break changes: split style on 69b0123
Input
break changes: remove BackgroundStyle
field on ef56197
Others
update deps
v0.11.2
- feat: add
select
help key filter 3d77305
only show choice
selectKeymap := singleselect.DefaultSingleKeyMap()
selectKeymap.Confirm = key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "finish select"),
)
selectKeymap.Choice = key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "finish select"),
)
selected, err := inf.NewSingleSelect(
options,
singleselect.WithDisableFilter(),
singleselect.WithKeyBinding(selectKeymap),
).Display("Hello world")
v0.11.1
release 0.10.1
release 0.8.8
Full Changelog: v0.8.7.2...v0.8.8
release 0.8.5
changelog:
- feat #28
- fix confirm(input)
OutputResult
andDisplayHelp
are not handled correctly autocomplete
adapt to the new features ofinput
release 0.8.4
- add confirm(selection) help view
- fix #29
release 0.8.2
Changelog
- add
FocusSymbol
UnFocusSymbol
FocusInterval
UnFocusInterval
toselection
,confirm(input)
- unify
quit
key so that it can be modified uniformly at runtime.
components.InterruptKey = key.NewBinding(
xxx
)
release 0.7.5
Allows you to exit the program at any time while the program is running,the key of the main response in the component is quit
, you can replace with the key you want, default is:
InterruptKey = key.NewBinding(
key.WithKeys("ctrl+c"),
key.WithHelp("^C", "kill program"),
)
default handle is :
OnUserInterrupt = func(p *tea.Program) {
p.Kill()
os.Exit(0)
}
You can modify it like this:
components.OnUserInterrupt = func(p *tea.Program) {
...
}
thanks @whatwewant .