Update checker segments
This commit is contained in:
parent
a43bb1c96d
commit
60faca6943
113
mood-line.el
113
mood-line.el
@ -512,30 +512,33 @@ Modal modes checked, in order: `evil-mode', `meow-mode', `god-mode'."
|
|||||||
(+ (if (eq backend 'Hg) 2 3)
|
(+ (if (eq backend 'Hg) 2 3)
|
||||||
2)))
|
2)))
|
||||||
(state (vc-state buffer-file-name
|
(state (vc-state buffer-file-name
|
||||||
(vc-backend buffer-file-name)))
|
(vc-backend buffer-file-name))))
|
||||||
(face 'mood-line-status-neutral)
|
|
||||||
(glyph :vc-good))
|
|
||||||
(cond
|
(cond
|
||||||
((memq state '(edited added))
|
((memq state '(edited added))
|
||||||
(setq face 'mood-line-status-info
|
(format #("%s %s "
|
||||||
glyph :vc-added))
|
0 2 (face mood-line-status-info))
|
||||||
|
(mood-line--get-glyph :vc-added)
|
||||||
|
branch))
|
||||||
((eq state 'needs-merge)
|
((eq state 'needs-merge)
|
||||||
(setq face 'mood-line-status-warning
|
(format #("%s %s "
|
||||||
glyph :vc-needs-merge))
|
0 2 (face mood-line-status-warning))
|
||||||
|
(mood-line--get-glyph :vc-needs-merge)
|
||||||
|
branch))
|
||||||
((eq state 'needs-update)
|
((eq state 'needs-update)
|
||||||
(setq face 'mood-line-status-warning
|
(format #("%s %s "
|
||||||
glyph :vc-needs-update))
|
0 2 (face mood-line-status-warning))
|
||||||
|
(mood-line--get-glyph :vc-needs-update)
|
||||||
|
branch))
|
||||||
((memq state '(removed conflict unregistered))
|
((memq state '(removed conflict unregistered))
|
||||||
(setq face 'mood-line-status-error
|
(format #("%s %s "
|
||||||
glyph :vc-conflict))
|
0 2 (face mood-line-status-error))
|
||||||
|
(mood-line--get-glyph :vc-conflict)
|
||||||
|
branch))
|
||||||
(t
|
(t
|
||||||
(setq face 'mood-line-status-neutral
|
(format #("%s %s "
|
||||||
glyph :vc-good)))
|
0 5 (face mood-line-status-neutral))
|
||||||
(propertize (concat (mood-line--get-glyph glyph)
|
(mood-line--get-glyph :vc-good)
|
||||||
" "
|
branch)))))))
|
||||||
branch
|
|
||||||
" ")
|
|
||||||
'face face)))))
|
|
||||||
|
|
||||||
;; ---------------------------------- ;;
|
;; ---------------------------------- ;;
|
||||||
;; Segment function
|
;; Segment function
|
||||||
@ -561,21 +564,21 @@ Modal modes checked, in order: `evil-mode', `meow-mode', `god-mode'."
|
|||||||
"Return alist with count of all error types in `flycheck-current-errors'.
|
"Return alist with count of all error types in `flycheck-current-errors'.
|
||||||
|
|
||||||
Counts will be returned in an alist as the `cdr' of the following keys:
|
Counts will be returned in an alist as the `cdr' of the following keys:
|
||||||
`'info-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
|
||||||
`'issues-count' | All errors and warnings reported by checker
|
`'issue-count' | All errors and warnings reported by checker
|
||||||
`'all-count' | Everything 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 ((info-count (+ (or .info 0)))
|
(let ((note-count (+ (or .info 0)))
|
||||||
(error-count (+ (or .error 0)))
|
(error-count (+ (or .error 0)))
|
||||||
(warning-count (+ (or .warning 0))))
|
(warning-count (+ (or .warning 0))))
|
||||||
`((info-count . ,info-count)
|
`((note-count . ,note-count)
|
||||||
(error-count . ,error-count)
|
(error-count . ,error-count)
|
||||||
(warning-count . ,warning-count)
|
(warning-count . ,warning-count)
|
||||||
(issues-count . ,(+ warning-count
|
(issue-count . ,(+ warning-count
|
||||||
error-count))
|
error-count))
|
||||||
(all-count . ,(+ info-count
|
(all-count . ,(+ note-count
|
||||||
warning-count
|
warning-count
|
||||||
error-count))))))
|
error-count))))))
|
||||||
|
|
||||||
@ -587,31 +590,31 @@ Counts will be returned in an alist as the `cdr' of the following keys:
|
|||||||
(let-alist (mood-line--checker-flycheck-count-errors)
|
(let-alist (mood-line--checker-flycheck-count-errors)
|
||||||
(cond
|
(cond
|
||||||
((> .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" "")))
|
||||||
((> .info-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" "")))
|
||||||
((zerop .all-count)
|
((zerop .all-count)
|
||||||
(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))))))
|
||||||
('running
|
('running
|
||||||
(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)))
|
||||||
('errored
|
('errored
|
||||||
(propertize (concat (mood-line--get-glyph :checker-errored)
|
(propertize (concat (mood-line--get-glyph :checker-errored)
|
||||||
" Error ")
|
" Error ")
|
||||||
@ -648,20 +651,20 @@ Counts will be returned in an alist as the `cdr' of the following keys:
|
|||||||
"Return alist with count of all current flymake diagnostic reports.
|
"Return alist with count of all current flymake diagnostic reports.
|
||||||
|
|
||||||
Counts will be returned in an alist as the cdr of the following keys:
|
Counts will be returned in an alist as the cdr of the following keys:
|
||||||
`'info-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
|
||||||
`'issues-count' | All errors and warnings reported by checker
|
`'issue-count' | All errors and warnings reported by checker
|
||||||
`'all-count' | Everything reported by checker"
|
`'all-count' | Everything reported by checker"
|
||||||
(let ((info-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)))
|
||||||
`((info-count . ,info-count)
|
`((note-count . ,note-count)
|
||||||
(error-count . ,error-count)
|
(error-count . ,error-count)
|
||||||
(warning-count . ,warning-count)
|
(warning-count . ,warning-count)
|
||||||
(issues-count . ,(+ warning-count
|
(issue-count . ,(+ warning-count
|
||||||
error-count))
|
error-count))
|
||||||
(all-count . ,(+ info-count
|
(all-count . ,(+ note-count
|
||||||
warning-count
|
warning-count
|
||||||
error-count)))))
|
error-count)))))
|
||||||
|
|
||||||
@ -689,7 +692,7 @@ Counts will be returned in an alist as the cdr of the following keys:
|
|||||||
(number-to-string .all-count)
|
(number-to-string .all-count)
|
||||||
" ")
|
" ")
|
||||||
'face 'mood-line-status-warning))
|
'face 'mood-line-status-warning))
|
||||||
((> .info-count 0)
|
((> .note-count 0)
|
||||||
(propertize (concat (mood-line--get-glyph :checker-info)
|
(propertize (concat (mood-line--get-glyph :checker-info)
|
||||||
" Info: "
|
" Info: "
|
||||||
(number-to-string .all-count)
|
(number-to-string .all-count)
|
||||||
|
Loading…
Reference in New Issue
Block a user