From 45f44bc21837976a2aa9d87fbf429aeecfa5abfb Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 1 Sep 2021 19:03:58 +0200 Subject: [PATCH] Prefer string variant for source-list-line-color config option (#2676) The string variant is more powerful and can be passed directly to "echo -e" / "printf" and friends. Remove the mention of the integer variant from the default config. This makes the option appear more consistent with other color options. The user shouldn't care about the historic differences. --- pkg/config/config.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index f1a24e46..83ef688d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -53,9 +53,8 @@ type Config struct { // expression for its argument. ShowLocationExpr bool `yaml:"show-location-expr"` - // Source list line-number color (3/4 bit color codes as defined - // here: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), - // or a string containing a terminal escape sequence. + // Source list line-number color, as a terminal escape sequence. + // For historic reasons, this can also be an integer color code. SourceListLineColor interface{} `yaml:"source-list-line-color"` // Source list arrow color, as a terminal escape sequence. @@ -228,11 +227,10 @@ func writeDefaultConfig(f *os.File) error { # This is the default configuration file. Available options are provided, but disabled. # Delete the leading hash mark to enable an item. -# Uncomment the following line and set your preferred ANSI foreground color -# for source line numbers in the (list) command (if unset, default is 34, -# dark blue) See https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit -# Alternatively a string containing an escape sequence can also be used. -# source-list-line-color: 34 +# Uncomment the following line and set your preferred ANSI color for source +# line numbers in the (list) command. The default is 34 (dark blue). See +# https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit +# source-list-line-color: "\x1b[34m" # Uncomment the following lines to change the colors used by syntax highlighting. # source-list-keyword-color: "\x1b[0m" -- GitLab