diff --git a/CHANGELOG b/CHANGELOG index 9ae5003..4ab8f51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ v1.4.9 (WIP) - Add InputField.GetCursorPosition and InputField.SetCursorPosition -- Upgrade tcell to v2 +- Upgrade tcell to v2: includes strikethrough support v1.4.8 (2020-08-11) - Add italic text formatting flag diff --git a/doc.go b/doc.go index ca8a22f..4345019 100644 --- a/doc.go +++ b/doc.go @@ -129,6 +129,7 @@ terminal): i: italic r: reverse (switch foreground and background color) u: underline + s: strikeout Examples: diff --git a/go.mod b/go.mod index 2fa58d0..159c9c8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitlab.com/tslocum/cview go 1.12 require ( - github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200830100347-23606a43e286 + github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200831064001-c008cc6a3b61 github.com/lucasb-eyer/go-colorful v1.0.3 github.com/mattn/go-runewidth v0.0.9 github.com/rivo/uniseg v0.1.0 diff --git a/go.sum b/go.sum index 7d5ef7e..6d73670 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.0.0-dev/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= -github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200830100347-23606a43e286 h1:29adRtDgT5AaOR9RiDQaZeiY+lb8mbQwz9WklTK6EuQ= -github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200830100347-23606a43e286/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= +github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200831064001-c008cc6a3b61 h1:61w16Im1XBJcfqvNoOgSjMaoBL50nRy2aqJ4LNWsXXY= +github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200831064001-c008cc6a3b61/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= diff --git a/util.go b/util.go index a3b4914..5d39819 100644 --- a/util.go +++ b/util.go @@ -159,6 +159,7 @@ func overlayStyle(background tcell.Color, defaultStyle tcell.Style, fgColor, bgC style = style.Italic(defAttr&tcell.AttrItalic > 0) style = style.Reverse(defAttr&tcell.AttrReverse > 0) style = style.Underline(defAttr&tcell.AttrUnderline > 0) + style = style.StrikeOut(defAttr&tcell.AttrStrikeOut > 0) } else if attributes != "" { style = style.Normal() for _, flag := range attributes { @@ -175,6 +176,8 @@ func overlayStyle(background tcell.Color, defaultStyle tcell.Style, fgColor, bgC style = style.Reverse(true) case 'u': style = style.Underline(true) + case 's': + style = style.StrikeOut(true) } } }