From 40eaac419dfd3a92a189816a9e2c1f4b779dbb8f Mon Sep 17 00:00:00 2001 From: eleksir Date: Fri, 27 Sep 2024 21:07:23 +0300 Subject: [PATCH] Transparently set sampleConfig.Separator.{Left,Right}.FontSize to sampleConfig.FontSize if it is not defined in config --- internal/lib/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/lib/config.go b/internal/lib/config.go index 87ff9bd..dda4942 100644 --- a/internal/lib/config.go +++ b/internal/lib/config.go @@ -361,6 +361,10 @@ func ReadConf(DefaultConfig []byte) (*MyConfig, error) { sampleConfig.Separator.Left.Font = sampleConfig.Font } + if sampleConfig.Separator.Left.FontSize == "" { + sampleConfig.Separator.Left.FontSize = sampleConfig.FontSize + } + matched, err := regexp.MatchString( `^(xx-small|x-small|small|medium|large|x-large|xx-large|smaller|larger)$`, sampleConfig.Separator.Left.FontSize, @@ -403,6 +407,10 @@ func ReadConf(DefaultConfig []byte) (*MyConfig, error) { sampleConfig.Separator.Right.Font = sampleConfig.Font } + if sampleConfig.Separator.Right.FontSize == "" { + sampleConfig.Separator.Right.FontSize = sampleConfig.FontSize + } + matched, err = regexp.MatchString( `^(xx-small|x-small|small|medium|large|x-large|xx-large|smaller|larger)$`, sampleConfig.Separator.Right.FontSize,