Prepare for any keys in blame listings.

This commit is contained in:
Dominik Pantůček 2023-05-15 18:58:30 +02:00
parent f37006ab09
commit ac4471bfc3
2 changed files with 23 additions and 14 deletions

View file

@ -140,7 +140,8 @@
(#:context-post ctx-post "") (#:context-post ctx-post "")
(#:highlight-pre hl-pre a:error) (#:highlight-pre hl-pre a:error)
(#:highlight-post hl-post a:default) (#:highlight-post hl-post a:default)
(#:context context 3)) (#:context context 3)
(#:keys keys '(number line comment)))
(let loop ((lines lines) (let loop ((lines lines)
(number 1) (number 1)
(printed-something #f) (printed-something #f)
@ -179,20 +180,27 @@
(add1 number) (add1 number)
#t #t
#t #t
(cons (list (format "\t~A~A. ~A" pre-str number post-str) (cons (map (lambda (key)
(case key
((number)
(format "\t~A~A. ~A" pre-str number post-str))
((line)
(format "~A~A~A" (format "~A~A~A"
pre-str pre-str
(if (ldict? line) (if (ldict? line)
(ldict-ref line 'line) (ldict-ref line 'line)
line) line)
post-str) post-str))
((comment)
(if comment (if comment
(format "~A # <<< ~A~A" (format "~A # <<< ~A~A"
pre-str pre-str
comment comment
post-str) post-str)
"") ""))
) (else
"xxx")))
keys)
rtbl))) rtbl)))
(loop (cdr lines) (loop (cdr lines)
(+ number 1) (+ number 1)

View file

@ -180,6 +180,7 @@
blame blame
hls hls
#:context -1 #:context -1
#:keys '(commit number line comment)
))) )))
;; Prints nicely printed payments ;; Prints nicely printed payments