Update flymake segment
This commit is contained in:
parent
74546fa7bb
commit
8e2eb970a0
56
mood-line.el
56
mood-line.el
@ -499,8 +499,7 @@ Counts will be returned in an alist as the `cdr' of the following keys:
|
|||||||
`'note-count' | All notes reported by checker
|
`'note-count' | All notes reported by checker
|
||||||
`'error-count' | All errors reported by checker
|
`'error-count' | All errors reported by checker
|
||||||
`'warning-count' | All warnings reported by checker
|
`'warning-count' | All warnings reported by checker
|
||||||
`'issue-count' | All errors and warnings reported by checker
|
`'issue-count' | All errors and warnings reported by checker"
|
||||||
`'all-count' | Everything reported by checker"
|
|
||||||
(let-alist (flycheck-count-errors flycheck-current-errors)
|
(let-alist (flycheck-count-errors flycheck-current-errors)
|
||||||
(let ((note-count (+ (or .info 0)))
|
(let ((note-count (+ (or .info 0)))
|
||||||
(error-count (+ (or .error 0)))
|
(error-count (+ (or .error 0)))
|
||||||
@ -509,9 +508,6 @@ Counts will be returned in an alist as the `cdr' of the following keys:
|
|||||||
(error-count . ,error-count)
|
(error-count . ,error-count)
|
||||||
(warning-count . ,warning-count)
|
(warning-count . ,warning-count)
|
||||||
(issue-count . ,(+ warning-count
|
(issue-count . ,(+ warning-count
|
||||||
error-count))
|
|
||||||
(all-count . ,(+ note-count
|
|
||||||
warning-count
|
|
||||||
error-count))))))
|
error-count))))))
|
||||||
|
|
||||||
(defun mood-line--checker-flycheck-update-segment (&optional status)
|
(defun mood-line--checker-flycheck-update-segment (&optional status)
|
||||||
@ -539,7 +535,7 @@ Counts will be returned in an alist as the `cdr' of the following keys:
|
|||||||
(mood-line--get-glyph :checker-info)
|
(mood-line--get-glyph :checker-info)
|
||||||
.note-count
|
.note-count
|
||||||
(if (> .note-count 1) "s" "")))
|
(if (> .note-count 1) "s" "")))
|
||||||
((zerop .all-count)
|
(t
|
||||||
(format #("%s No Issues "
|
(format #("%s No Issues "
|
||||||
0 12 (face mood-line-status-neutral))
|
0 12 (face mood-line-status-neutral))
|
||||||
(mood-line--get-glyph :checker-good))))))
|
(mood-line--get-glyph :checker-good))))))
|
||||||
@ -586,8 +582,7 @@ Counts will be returned in an alist as the cdr of the following keys:
|
|||||||
`'note-count' | All notes reported by checker
|
`'note-count' | All notes reported by checker
|
||||||
`'error-count' | All errors reported by checker
|
`'error-count' | All errors reported by checker
|
||||||
`'warning-count' | All warnings reported by checkero
|
`'warning-count' | All warnings reported by checkero
|
||||||
`'issue-count' | All errors and warnings reported by checker
|
`'issue-count' | All errors and warnings reported by checker"
|
||||||
`'all-count' | Everything reported by checker"
|
|
||||||
(let ((note-count (mood-line--checker-flymake-count-report-type :note))
|
(let ((note-count (mood-line--checker-flymake-count-report-type :note))
|
||||||
(error-count (mood-line--checker-flymake-count-report-type :error))
|
(error-count (mood-line--checker-flymake-count-report-type :error))
|
||||||
(warning-count (mood-line--checker-flymake-count-report-type :warning)))
|
(warning-count (mood-line--checker-flymake-count-report-type :warning)))
|
||||||
@ -595,9 +590,6 @@ Counts will be returned in an alist as the cdr of the following keys:
|
|||||||
(error-count . ,error-count)
|
(error-count . ,error-count)
|
||||||
(warning-count . ,warning-count)
|
(warning-count . ,warning-count)
|
||||||
(issue-count . ,(+ warning-count
|
(issue-count . ,(+ warning-count
|
||||||
error-count))
|
|
||||||
(all-count . ,(+ note-count
|
|
||||||
warning-count
|
|
||||||
error-count)))))
|
error-count)))))
|
||||||
|
|
||||||
(defun mood-line--checker-flymake-update-segment (&rest _)
|
(defun mood-line--checker-flymake-update-segment (&rest _)
|
||||||
@ -609,31 +601,31 @@ Counts will be returned in an alist as the cdr of the following keys:
|
|||||||
(cond
|
(cond
|
||||||
((seq-difference (flymake-running-backends)
|
((seq-difference (flymake-running-backends)
|
||||||
(flymake-reporting-backends))
|
(flymake-reporting-backends))
|
||||||
(propertize (concat (mood-line--get-glyph :checker-checking)
|
(format #("%s Checking "
|
||||||
" Checking ")
|
0 12 (face mood-line-status-neutral))
|
||||||
'face 'mood-line-status-info))
|
(mood-line--get-glyph :checker-checking)))
|
||||||
((> .error-count 0)
|
((> .error-count 0)
|
||||||
(propertize (concat (mood-line--get-glyph :checker-issues)
|
(format #("%s %s Issue%s "
|
||||||
" Errors: "
|
0 2 (face mood-line-status-error))
|
||||||
(number-to-string .all-count)
|
(mood-line--get-glyph :checker-issues)
|
||||||
" ")
|
.issue-count
|
||||||
'face 'mood-line-status-error))
|
(if (> .issue-count 1) "s" "")))
|
||||||
((> .warning-count 0)
|
((> .warning-count 0)
|
||||||
(propertize (concat (mood-line--get-glyph :checker-issues)
|
(format #("%s %s Issue%s "
|
||||||
" Issues: "
|
0 2 (face mood-line-status-warning))
|
||||||
(number-to-string .all-count)
|
(mood-line--get-glyph :checker-issues)
|
||||||
" ")
|
.issue-count
|
||||||
'face 'mood-line-status-warning))
|
(if (> .issue-count 1) "s" "")))
|
||||||
((> .note-count 0)
|
((> .note-count 0)
|
||||||
(propertize (concat (mood-line--get-glyph :checker-info)
|
(format #("%s %s Note%s "
|
||||||
" Info: "
|
0 2 (face mood-line-status-info))
|
||||||
(number-to-string .all-count)
|
(mood-line--get-glyph :checker-info)
|
||||||
" ")
|
.note-count
|
||||||
'face 'mood-line-status-info))
|
(if (> .note-count 1) "s" "")))
|
||||||
(t
|
(t
|
||||||
(propertize (concat (mood-line--get-glyph :checker-good)
|
(format #("%s No Issues "
|
||||||
" Good ")
|
0 12 (face mood-line-status-neutral))
|
||||||
'face 'mood-line-status-success)))))))
|
(mood-line--get-glyph :checker-good))))))))
|
||||||
|
|
||||||
;; ---------------------------------- ;;
|
;; ---------------------------------- ;;
|
||||||
;; Flymake segment function
|
;; Flymake segment function
|
||||||
|
Loading…
Reference in New Issue
Block a user