Merge branch 'main' into feature/yank

This commit is contained in:
T.v.Dein
2025-02-23 18:09:04 +01:00
committed by GitHub
18 changed files with 454 additions and 144 deletions

View File

@@ -301,12 +301,20 @@ func colorizeData(conf cfg.Config, output string) string {
return colorized
case len(conf.Pattern) > 0 && !conf.NoColor && color.IsConsole(os.Stdout):
r := regexp.MustCompile("(" + conf.Pattern + ")")
case len(conf.Patterns) > 0 && !conf.NoColor && color.IsConsole(os.Stdout):
out := output
return r.ReplaceAllStringFunc(output, func(in string) string {
return conf.ColorStyle.Sprint(in)
})
for _, re := range conf.Patterns {
if !re.Negate {
r := regexp.MustCompile("(" + re.Pattern + ")")
out = r.ReplaceAllStringFunc(out, func(in string) string {
return conf.ColorStyle.Sprint(in)
})
}
}
return out
default:
return output