Update CHANGELOG

This commit is contained in:
c-bata 2018-06-28 15:44:23 +09:00
parent 6fe109b09d
commit 58b39dbb6c
3 changed files with 19 additions and 25 deletions

View File

@ -2,7 +2,25 @@
## v0.3.0 (2018/??/??)
next release.
The architecture of go-prompt are refactored in this release. See [here](https://github.com/c-bata/go-prompt/pull/83) for more details.
Much better in many regards. Please don't hesitate to test this release and file any bug reports.
### Breaking changes.
Please caution this release includes breaking changes for who customize ConsoleParser or ConsoleWriter.
* Remove `GetWinSize` method from `ConsoleParser`. Please use `ConsoleWriter.GetWinSize` instead.
* Remove `GetKey` method from `ConsoleParser`. Please use `GetKey` function instead.
* Add `GetWinSize` and `SIGWINCH` on `ConsoleWriter`.
### What's new?
* Correspond window size change events on Windows.
### Removed or Deprecated
* Removed Choose shortcut function.
* Removed SwitchKeyBindMode option. please use OptionSwitchKeyBindMode instead.
## v0.2.2 (2018/06/28)

View File

@ -248,10 +248,6 @@ func OptionSwitchKeyBindMode(m KeyBindMode) Option {
}
}
// SwitchKeyBindMode to set a key bind mode.
// Deprecated: Please use OptionSwitchKeyBindMode.
var SwitchKeyBindMode = OptionSwitchKeyBindMode
// OptionAddKeyBind to set a custom key bind.
func OptionAddKeyBind(b ...KeyBind) Option {
return func(p *Prompt) error {

View File

@ -9,23 +9,3 @@ func Input(prefix string, completer Completer, opts ...Option) string {
return pt.Input()
}
// Choose to the shortcut of input function to select from string array.
// Deprecated: Maybe anyone want to use this.
func Choose(prefix string, choices []string, opts ...Option) string {
completer := newChoiceCompleter(choices, FilterHasPrefix)
pt := New(nil, completer, opts...)
pt.rendererOptions = append(pt.rendererOptions, func(r *Renderer) {
r.prefix = prefix
})
return pt.Input()
}
func newChoiceCompleter(choices []string, filter Filter) Completer {
s := make([]Suggest, len(choices))
for i := range choices {
s[i] = Suggest{Text: choices[i]}
}
return func(x Document) []Suggest {
return filter(s, x.GetWordBeforeCursor(), true)
}
}