diff --git a/cell/cell_test.go b/cell/cell_test.go index 329fdb7..1447e3f 100644 --- a/cell/cell_test.go +++ b/cell/cell_test.go @@ -80,12 +80,16 @@ func TestNewOptions(t *testing.T) { Italic(), Underline(), Strikethrough(), + Inverse(), + Blink(), }, want: &Options{ Bold: true, Italic: true, Underline: true, Strikethrough: true, + Inverse: true, + Blink: true, }, }, } diff --git a/terminal/tcell/cell_options.go b/terminal/tcell/cell_options.go index 21be5f2..b23fa3c 100644 --- a/terminal/tcell/cell_options.go +++ b/terminal/tcell/cell_options.go @@ -63,6 +63,13 @@ func cellOptsToStyle(opts *cell.Options, colorMode terminalapi.ColorMode) tcell. fg := cellColor(colorToMode(opts.FgColor, colorMode)) bg := cellColor(colorToMode(opts.BgColor, colorMode)) - st = st.Foreground(fg).Background(bg).Bold(opts.Bold).Italic(opts.Italic).Underline(opts.Underline).StrikeThrough(opts.Strikethrough).Reverse(opts.Inverse).Blink(opts.Blink) + st = st.Foreground(fg). + Background(bg). + Bold(opts.Bold). + Italic(opts.Italic). + Underline(opts.Underline). + StrikeThrough(opts.Strikethrough). + Reverse(opts.Inverse). + Blink(opts.Blink) return st } diff --git a/terminal/termbox/cell_options.go b/terminal/termbox/cell_options.go index faa79ce..7386451 100644 --- a/terminal/termbox/cell_options.go +++ b/terminal/termbox/cell_options.go @@ -49,21 +49,21 @@ func cellOptsToFg(opts *cell.Options) (tbx.Attribute, error) { if opts.Bold { a |= tbx.AttrBold } - // FIXME: Termbox doesn't have an italics attribute + // Termbox doesn't have an italics attribute if opts.Italic { return 0, errors.New("Termbox: Unsupported attribute: Italic") } if opts.Underline { a |= tbx.AttrUnderline } - // FIXME: Termbox doesn't have a strikethrough attribute + // Termbox doesn't have a strikethrough attribute if opts.Strikethrough { return 0, errors.New("Termbox: Unsupported attribute: Strikethrough") } if opts.Inverse { a |= tbx.AttrReverse } - // FIXME: Termbox doesn't have a blink attribute + // Termbox doesn't have a blink attribute if opts.Blink { return 0, errors.New("Termbox: Unsupported attribute: Blink") } diff --git a/terminal/termbox/cell_options_test.go b/terminal/termbox/cell_options_test.go index 7c76089..e12c3b9 100644 --- a/terminal/termbox/cell_options_test.go +++ b/terminal/termbox/cell_options_test.go @@ -60,7 +60,7 @@ func TestCellFontModifier(t *testing.T) { {cell.Options{Underline: true}, tbx.AttrUnderline, false}, {cell.Options{Italic: true}, 0, true}, {cell.Options{Strikethrough: true}, 0, true}, - {cell.Options{Inverse: true}, tbx.AttrReverse, true}, + {cell.Options{Inverse: true}, tbx.AttrReverse, false}, {cell.Options{Blink: true}, 0, true}, }