diff options
author | Arun Isaac | 2021-09-29 17:37:59 +0530 |
---|---|---|
committer | Arun Isaac | 2021-09-29 17:37:59 +0530 |
commit | 44ab323da4b298e5ae770a1c84921d25049b75da (patch) | |
tree | 506b738b6e44938bea18cfe31dab8684b61797d6 /gnbug | |
parent | 6c9bd2d179bf50cab020618b1e8cb526cbe8d1ca (diff) | |
download | gn-gemtext-44ab323da4b298e5ae770a1c84921d25049b75da.tar.gz |
gnbug: Detect bug or critical only as whole words in keywords.
This is to prevent mistaken detection of the keyword "gnbug" as having
"bug" in it.
* gnbug (print-issue): Detect bug or critical only as whole words in
keywords.
Diffstat (limited to 'gnbug')
-rwxr-xr-x | gnbug | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -334,15 +334,17 @@ List recent updates. (define (print-issue issue-number issue) "Print ISSUE with number ISSUE-NUMBER." (display (magenta (issue-title issue))) - ;; Highlight keywords containing "bug" or "critical" in red. Else, - ;; highlight in blue. + ;; Highlight keywords containing "bug" or "critical" as whole words + ;; in red. Else, highlight in blue. (unless (null? (issue-keywords issue)) (display " ") (display (string-join (map (lambda (keyword) ((cond - ((any (cut string-contains keyword <>) - (list "bug" "critical")) + ((not (null? (lset-intersection + string=? + (string-split keyword #\space) + (list "bug" "critical")))) red-background) (else blue-background)) (string-append " " keyword " "))) |