From c294f284be3627f44da66c4b21686b7f3a8df878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Wed, 17 Jun 2026 21:26:21 +0200 Subject: [PATCH] colors: Add `blink`, `dim` and `strikethrough` to the colorscheme attributes --- internal/config/colorscheme.go | 9 +++++++++ internal/config/colorscheme_test.go | 6 +++++- runtime/help/colors.md | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/config/colorscheme.go b/internal/config/colorscheme.go index 1058ab5286..eab0458b97 100644 --- a/internal/config/colorscheme.go +++ b/internal/config/colorscheme.go @@ -196,12 +196,21 @@ func StringToStyle(str string) tcell.Style { if strings.Contains(str, "bold") { style = style.Bold(true) } + if strings.Contains(str, "blink") { + style = style.Blink(true) + } + if strings.Contains(str, "dim") { + style = style.Dim(true) + } if strings.Contains(str, "italic") { style = style.Italic(true) } if strings.Contains(str, "reverse") { style = style.Reverse(true) } + if strings.Contains(str, "strikethrough") { + style = style.StrikeThrough(true) + } if strings.Contains(str, "underline") { style = style.Underline(true) } diff --git a/internal/config/colorscheme_test.go b/internal/config/colorscheme_test.go index 5aeeeeba60..6380d1a5fb 100644 --- a/internal/config/colorscheme_test.go +++ b/internal/config/colorscheme_test.go @@ -27,14 +27,18 @@ func TestAttributeStringToStyle(t *testing.T) { } func TestMultiAttributesStringToStyle(t *testing.T) { - s := StringToStyle("bold italic underline cyan,brightcyan") + s := StringToStyle("bold blink dim italic reverse strikethrough underline cyan,brightcyan") fg, bg, attr := s.Decompose() assert.Equal(t, tcell.ColorTeal, fg) assert.Equal(t, tcell.ColorAqua, bg) assert.NotEqual(t, 0, attr&tcell.AttrBold) + assert.NotEqual(t, 0, attr&tcell.AttrBlink) + assert.NotEqual(t, 0, attr&tcell.AttrDim) assert.NotEqual(t, 0, attr&tcell.AttrItalic) + assert.NotEqual(t, 0, attr&tcell.AttrReverse) + assert.NotEqual(t, 0, attr&tcell.AttrStrikeThrough) assert.NotEqual(t, 0, attr&tcell.AttrUnderline) } diff --git a/runtime/help/colors.md b/runtime/help/colors.md index 7437108731..7f7ce58075 100644 --- a/runtime/help/colors.md +++ b/runtime/help/colors.md @@ -130,7 +130,8 @@ If you would like no foreground you can just use a comma with nothing in front: color-link comment ",blue" ``` -You can also put bold, italic, or underline in front of the color: +You can also put bold, blink, dim, italic, reverse, strikethrough and underline +in front of the color: ``` color-link comment "bold red"