Transparently set sampleConfig.Separator.{Left,Right}.FontSize to sampleConfig.FontSize if it is not defined in config
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user