1
0
mirror of https://github.com/mum4k/termdash.git synced 2025-04-25 13:48:50 +08:00

Merge branch 'devel' into donut

This commit is contained in:
Jakub Sobon 2019-01-19 20:52:27 -05:00
commit ebc275c4b3
3 changed files with 8 additions and 16 deletions

View File

@ -50,11 +50,11 @@ const (
// ColorMode216 supports only the third range of the ColorMode256, i.e the
// 216 different terminal colors. However in this mode the colors are zero
// based, so the called doesn't need to provide an offset.
// based, so the caller doesn't need to provide an offset.
ColorMode216
// ColorModeGrayscale supports only the fourth range of the ColorMode256,
// i.e the 24 different shades of grey. However in this mode the colors are
// zero based, so the called doesn't need to provide an offset.
// zero based, so the caller doesn't need to provide an offset.
ColorModeGrayscale
)

View File

@ -240,7 +240,7 @@ func (t *Text) Draw(cvs *canvas.Canvas) error {
return nil
}
// Implements widgetapi.Widget.Keyboard.
// Keyboard implements widgetapi.Widget.Keyboard.
func (t *Text) Keyboard(k *terminalapi.Keyboard) error {
t.mu.Lock()
defer t.mu.Unlock()
@ -258,7 +258,7 @@ func (t *Text) Keyboard(k *terminalapi.Keyboard) error {
return nil
}
// Implements widgetapi.Widget.Mouse.
// Mouse implements widgetapi.Widget.Mouse.
func (t *Text) Mouse(m *terminalapi.Mouse) error {
t.mu.Lock()
defer t.mu.Unlock()
@ -272,6 +272,7 @@ func (t *Text) Mouse(m *terminalapi.Mouse) error {
return nil
}
// Options of the widget
func (t *Text) Options() widgetapi.Options {
return widgetapi.Options{
// At least one line with at least one full-width rune.

View File

@ -99,10 +99,7 @@ func TestTextDraws(t *testing.T) {
if err := widget.Write(" "); err != nil {
return err
}
if err := widget.Write("world"); err != nil {
return err
}
return nil
return widget.Write("world")
},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)
@ -124,10 +121,7 @@ func TestTextDraws(t *testing.T) {
return err
}
widget.Reset()
if err := widget.Write("world"); err != nil {
return err
}
return nil
return widget.Write("world")
},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)
@ -164,10 +158,7 @@ func TestTextDraws(t *testing.T) {
if err := widget.Write("red\n", WriteCellOpts(cell.FgColor(cell.ColorRed))); err != nil {
return err
}
if err := widget.Write("blue\n", WriteCellOpts(cell.FgColor(cell.ColorBlue))); err != nil {
return err
}
return nil
return widget.Write("blue\n", WriteCellOpts(cell.FgColor(cell.ColorBlue)))
},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)