Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce flycheck-mode-line-lighter-base and use it, with test #880

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion flycheck.el
Expand Up @@ -888,6 +888,18 @@ Set this variable to nil to disable the mode line completely."
:risky t
:package-version '(flycheck . "0.20"))

(defcustom flycheck-mode-line-prefix "FlyC"
"Base mode line lighter for Flycheck.

This will have an effect only with the default
`flycheck-mode-line'.

If you've customized `flycheck-mode-line' then the customized
function must be updated to use this variable."
:group 'flycheck
:type 'string
:package-version '(flycheck . "0.26"))

(defcustom flycheck-error-list-mode-line
`(,(propertized-buffer-identification "%12b")
" for buffer "
Expand Down Expand Up @@ -3072,7 +3084,7 @@ nil."
"")))
(`interrupted "-")
(`suspicious "?"))))
(concat " FlyC" text)))
(concat " " flycheck-mode-line-prefix text)))


;;; Error levels
Expand Down
9 changes: 9 additions & 0 deletions test/flycheck-test.el
Expand Up @@ -1745,6 +1745,15 @@ and extension, as in `file-name-base'."
(list (flycheck-error-new-at 1 1 'info "info"))))
(should (string= (flycheck-mode-line-status-text 'finished) " FlyC")))))

(ert-deftest flycheck-mode-line/customize-lighter ()
:tags '(status-reporting)
(flycheck-ert-with-temp-buffer
(let ((flycheck-mode-line-prefix "FFFLLLYYYCCCHHHEEECCCKKK")
(flycheck-current-errors
(list (flycheck-error-new-at 1 1 'info "info"))))
(should (string= (flycheck-mode-line-status-text 'finished)
" FFFLLLYYYCCCHHHEEECCCKKK")))))


;;; Error levels
;; A level for the following unit tests
Expand Down