From c52492ff1b386e5c0ba5271b5eaad165fab09eca Mon Sep 17 00:00:00 2001 From: Masashi SHIBATA Date: Thu, 28 Jun 2018 22:06:28 +0900 Subject: [PATCH] Update CHANGELOG for v0.2.2 release. (#84) --- CHANGELOG.md | 11 +++++------ document.go | 12 ++++-------- key_bind_func.go | 2 +- option.go | 2 +- output.go | 5 +---- output_vt100.go | 3 +-- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e6a534..a1fcb27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log -## v0.2.2 (2018/??/??) +## v0.3.0 (2018/??/??) + +next release. + +## v0.2.2 (2018/06/28) ### What's new? @@ -10,11 +14,6 @@ * Add FilePathCompleter to complete file path on your system. * Add option to customize ascii code key bindings. * Add GetWordAfterCursor method in Document. -* Add SetDisplayAttributes in ConsoleWriter for flexible customizing display attributes. - -### Fixed - -* Fix a bug in docker container [issue #39](https://github.com/c-bata/go-prompt/issues/39) ### Removed or Deprecated diff --git a/document.go b/document.go index 4d284fa..06b436a 100644 --- a/document.go +++ b/document.go @@ -125,9 +125,8 @@ func (d *Document) FindStartOfPreviousWord() int { i := strings.LastIndexByte(x, ' ') if i != -1 { return i + 1 - } else { - return 0 } + return 0 } // FindStartOfPreviousWordWithSpace is almost the same as FindStartOfPreviousWord. @@ -157,9 +156,8 @@ func (d *Document) FindStartOfPreviousWordUntilSeparator(sep string) int { i := strings.LastIndexAny(x, sep) if i != -1 { return i + 1 - } else { - return 0 } + return 0 } // FindStartOfPreviousWordUntilSeparatorIgnoreNextToCursor is almost the same as FindStartOfPreviousWordWithSpace. @@ -188,9 +186,8 @@ func (d *Document) FindEndOfCurrentWord() int { i := strings.IndexByte(x, ' ') if i != -1 { return i - } else { - return len(x) } + return len(x) } // FindEndOfCurrentWordWithSpace is almost the same as FindEndOfCurrentWord. @@ -222,9 +219,8 @@ func (d *Document) FindEndOfCurrentWordUntilSeparator(sep string) int { i := strings.IndexAny(x, sep) if i != -1 { return i - } else { - return len(x) } + return len(x) } // FindEndOfCurrentWordUntilSeparatorIgnoreNextToCursor is almost the same as FindEndOfCurrentWordWithSpace. diff --git a/key_bind_func.go b/key_bind_func.go index 11b5031..7b2ecdf 100644 --- a/key_bind_func.go +++ b/key_bind_func.go @@ -1,6 +1,6 @@ package prompt -// CursorLineEnd Go to the End of the line +// GoLineEnd Go to the End of the line func GoLineEnd(buf *Buffer) { x := []rune(buf.Document().TextAfterCursor()) buf.CursorRight(len(x)) diff --git a/option.go b/option.go index f414a6b..9a7f386 100644 --- a/option.go +++ b/option.go @@ -217,7 +217,7 @@ func OptionAddKeyBind(b ...KeyBind) Option { } } -// OptionAddKeyBind to set a custom key bind. +// OptionAddASCIICodeBind to set a custom key bind. func OptionAddASCIICodeBind(b ...ASCIICodeBind) Option { return func(p *Prompt) error { p.ASCIICodeBindings = append(p.ASCIICodeBindings, b...) diff --git a/output.go b/output.go index 7240df0..5afb81c 100644 --- a/output.go +++ b/output.go @@ -16,7 +16,7 @@ const ( DisplayUnderline // DisplayBlink set blink (less than 150 per minute). DisplayBlink - // DisplayBlink set blink (more than 150 per minute). Not widely supported. + // DisplayRapidBlink set blink (more than 150 per minute). Not widely supported. DisplayRapidBlink // DisplayReverse swap foreground and background colors. DisplayReverse @@ -144,8 +144,5 @@ type ConsoleWriter interface { /* Font */ // SetColor sets text and background colors. and specify whether text is bold. - // Deprecated. This interface is not cool, please use SetDisplayAttributes. SetColor(fg, bg Color, bold bool) - // SetDisplayAttributes set display attributes (Set colors, blink, bold, italic and so on). - SetDisplayAttributes(fg, bg Color, attrs ...DisplayAttribute) } diff --git a/output_vt100.go b/output_vt100.go index 7fdabdc..3b3031d 100644 --- a/output_vt100.go +++ b/output_vt100.go @@ -232,7 +232,6 @@ func (w *VT100Writer) ClearTitle() { /* Font */ // SetColor sets text and background colors. and specify whether text is bold. -// Deprecated. This interface is not cool, please use SetDisplayAttributes. func (w *VT100Writer) SetColor(fg, bg Color, bold bool) { if bold { w.SetDisplayAttributes(fg, bg, DisplayBold) @@ -242,7 +241,7 @@ func (w *VT100Writer) SetColor(fg, bg Color, bold bool) { return } -// SetDisplayAttributes set display attributes (Set colors, blink, bold, italic and so on). +// SetDisplayAttributes to set VT100 display attributes. func (w *VT100Writer) SetDisplayAttributes(fg, bg Color, attrs ...DisplayAttribute) { w.WriteRaw([]byte{0x1b, '['}) // control sequence introducer defer w.WriteRaw([]byte{'m'}) // final character