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.
This commit is contained in:
Johannes Altmanninger
2021-09-01 19:03:58 +02:00
committed by GitHub
parent 47d07e095c
commit 45f44bc218

View File

@ -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"