diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-05-04 15:08:23 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-05-04 15:08:23 +0900 |
| commit | c6d83047e5662214a0e6e4f341e5c952a53d524a (patch) | |
| tree | 6b67d99cebe4e4572e46aaa207171fb53a16c964 /src/options.go | |
| parent | 46dabccdf1f5d79489453379ecadb9d8f4d82ed6 (diff) | |
| download | fzf-c6d83047e5662214a0e6e4f341e5c952a53d524a.tar.gz | |
Allow whitespace as separator in --color option
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/options.go b/src/options.go index 1e4c8904..030368fa 100644 --- a/src/options.go +++ b/src/options.go @@ -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) |
