Refactoring.

This commit is contained in:
Vincent St-Amour 2012-07-02 17:43:35 -04:00
parent 8b64dc8aef
commit c5d9f6a228

View File

@ -59,14 +59,6 @@
;; a single sub. ;; a single sub.
(init-field [filters (map cdr check-boxes)]) ; all enabled by default (init-field [filters (map cdr check-boxes)]) ; all enabled by default
(define/private (highlight-entry l)
(match l
[(report-entry subs start end badness)
(let ([color (if (= badness 0)
"lightgreen"
(vector-ref color-table badness))])
(highlight-to-end-of-text start end color l))]))
;; highlight-range, for ranges that span multiple lines, highlights ;; highlight-range, for ranges that span multiple lines, highlights
;; to the end of the first n-1 lines. Since the space at end of lines ;; to the end of the first n-1 lines. Since the space at end of lines
;; does not have editor positions, I can't figure out how to make the ;; does not have editor positions, I can't figure out how to make the
@ -74,7 +66,11 @@
;; have positions). To work around that, we highlight only the code ;; have positions). To work around that, we highlight only the code
;; proper, not the space at the end of lines. That way, everywhere in ;; proper, not the space at the end of lines. That way, everywhere in
;; the highlight has a position, and can spawn popup menus. ;; the highlight has a position, and can spawn popup menus.
(define/private (highlight-to-end-of-text start end color l) (define/private (highlight-entry l)
(match-define (report-entry subs start end badness) l)
(define color (if (= badness 0)
"lightgreen"
(vector-ref color-table badness)))
(define (highlight-part start end) (define (highlight-part start end)
(highlight-range start end color #f 'high) (highlight-range start end color #f 'high)
(set-clickback start end (popup-callback l)) (set-clickback start end (popup-callback l))