diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-11-24 00:13:10 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-11-24 00:13:10 +0900 |
commit | 182a6d99fd550e2106298a19b542bdf940621ed1 (patch) | |
tree | 308304e8c45aec1d8e898b15a790699570049023 /src | |
parent | af31088481f6898069c3c579f21da447025a389b (diff) |
[ncurses6] Support italics
Diffstat (limited to 'src')
-rw-r--r-- | src/ansi.go | 12 | ||||
-rw-r--r-- | src/tui/ncurses.go | 3 | ||||
-rw-r--r-- | src/tui/tcell.go | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/ansi.go b/src/ansi.go index 427f7f4c..f8fe56a1 100644 --- a/src/ansi.go +++ b/src/ansi.go @@ -143,15 +143,17 @@ func interpretCode(ansiCode string, prevState *ansiState) *ansiState { case 49: state.bg = -1 case 1: - state.attr = tui.Bold + state.attr = state.attr | tui.Bold case 2: - state.attr = tui.Dim + state.attr = state.attr | tui.Dim + case 3: + state.attr = state.attr | tui.Italic case 4: - state.attr = tui.Underline + state.attr = state.attr | tui.Underline case 5: - state.attr = tui.Blink + state.attr = state.attr | tui.Blink case 7: - state.attr = tui.Reverse + state.attr = state.attr | tui.Reverse case 0: init() default: diff --git a/src/tui/ncurses.go b/src/tui/ncurses.go index ac75513a..6e9ddb41 100644 --- a/src/tui/ncurses.go +++ b/src/tui/ncurses.go @@ -30,7 +30,7 @@ import ( ) type ColorPair int16 -type Attr C.int +type Attr C.uint type WindowImpl C.WINDOW const ( @@ -39,6 +39,7 @@ const ( Blink = C.A_BLINK Reverse = C.A_REVERSE Underline = C.A_UNDERLINE + Italic = C.A_VERTICAL << 1 // FIXME ) const ( diff --git a/src/tui/tcell.go b/src/tui/tcell.go index efa112a9..3fe1161d 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -48,6 +48,7 @@ const ( Blink = Attr(tcell.AttrBlink) Reverse = Attr(tcell.AttrReverse) Underline = Attr(tcell.AttrUnderline) + Italic = Attr(tcell.AttrNone) // Not supported ) const ( |