Allow displaying --nth parts in a different text style

Close #4183
This commit is contained in:
Junegunn Choi
2025-01-16 01:38:45 +09:00
parent b42f5bfb19
commit 3e7f032ec2
8 changed files with 128 additions and 36 deletions

View File

@@ -1207,6 +1207,8 @@ func parseTheme(defaultTheme *tui.ColorTheme, str string) (*tui.ColorTheme, erro
mergeAttr(&theme.SelectedFg)
case "selected-bg":
mergeAttr(&theme.SelectedBg)
case "nth":
mergeAttr(&theme.Nth)
case "gutter":
mergeAttr(&theme.Gutter)
case "hl":
@@ -2966,6 +2968,10 @@ func validateOptions(opts *Options) error {
}
}
if opts.Theme.Nth.IsColorDefined() {
return errors.New("only ANSI attributes are allowed for 'nth' (regular, bold, underline, reverse, dim, italic, strikethrough)")
}
return nil
}