m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-14 14:23:47 -05:00

Allow whitespace as separator in --color option

This commit is contained in:
Junegunn Choi
2025-05-04 15:08:23 +09:00
parent 46dabccdf1
commit c6d83047e5
4 changed files with 35 additions and 4 deletions

View File

@@ -1184,7 +1184,12 @@ func parseTheme(defaultTheme *tui.ColorTheme, str string) (*tui.ColorTheme, erro
var err error
theme := dupeTheme(defaultTheme)
rrggbb := regexp.MustCompile("^#[0-9a-fA-F]{6}$")
for _, str := range strings.Split(strings.ToLower(str), ",") {
comma := regexp.MustCompile(`[\s,]+`)
for _, str := range comma.Split(strings.ToLower(str), -1) {
str = strings.TrimSpace(str)
if len(str) == 0 {
continue
}
switch str {
case "dark":
theme = dupeTheme(tui.Dark256)