diff options
| -rw-r--r-- | fish/conf.d/taskwarrior.fish | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fish/conf.d/taskwarrior.fish b/fish/conf.d/taskwarrior.fish index 3e1e9e7..1d0ba49 100644 --- a/fish/conf.d/taskwarrior.fish +++ b/fish/conf.d/taskwarrior.fish @@ -269,9 +269,9 @@ end # Parses a random-quote entry. If it matches "word: description", echoes project then description (one per line); otherwise echoes empty then entry. function _taskwarrior::random_quote_parse_entry set -l entry "$argv[1]" - if string match -q -r '^[^:]+: .+' -- $entry - echo (string lower -- (string trim -- (string replace -r '^([^:]+): (.+)$' '$1' -- $entry))) - echo (string replace -r '^([^:]+): (.+)$' '$2' -- $entry) + if string match -q -r '^\S+: .+' -- $entry + echo (string lower -- (string trim -- (string replace -r '^(\S+): (.+)$' '$1' -- $entry))) + echo (string replace -r '^(\S+): (.+)$' '$2' -- $entry) else echo "" echo $entry |
