#323 Document ale#statusline#Count() instead, and encourage its use

This commit is contained in:
w0rp 2017-05-24 10:23:13 +01:00
parent 58880f33be
commit 92ade713f2
3 changed files with 15 additions and 21 deletions

View File

@ -90,6 +90,9 @@ function! s:StatusForListFormat() abort
endfunction
" Returns a formatted string that can be integrated in the statusline.
"
" This function is deprecated, and should not be used. Use the airline plugin
" instead, or write your own status function with ale#statusline#Count()
function! ale#statusline#Status() abort
if !exists('g:ale_statusline_format')
return 'OK'

View File

@ -646,17 +646,6 @@ g:ale_sign_warning *g:ale_sign_warning*
The sign for warnings in the sign gutter.
g:ale_statusline_format *g:ale_statusline_format*
Type: |List|
Default: `['%d error(s)', '%d warning(s)', 'OK']`
This variable defines the format of |`ale#statusline#status()`| output.
- The 1st element is for errors
- The 2nd element is for warnings
- The 3rd element is for when no errors are detected
g:ale_warn_about_trailing_whitespace *g:ale_warn_about_trailing_whitespace*
b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*
@ -1102,12 +1091,17 @@ ale#linter#Get(filetype) *ale#linter#Get()*
components.
ale#statusline#Status() *ale#statusline#Status()*
ale#statusline#Count() *ale#statusline#Count()*
Return a formatted string that can be added to the statusline.
The output's format is defined in |`g:ale_statusline_format`|.
To enable it, the following should be present in your |statusline| settings: >
%{ale#statusline#Status()}
Returns a |Dictionary| containing information about the number of problems
detected by ALE. The following keys are supported:
`error` -> The number of problems with type `E` and `sub_type != 'style'`
`warning` -> The number of problems with type `W` and `sub_type != 'style'`
`info` -> The number of problems with type `I`
`style_error` -> The number of problems with type `E` and `sub_type == 'style'`
`style_warning` -> The number of problems with type `W` and `sub_type == 'style'`
`total` -> The total number of problems.
ALELint *ALELint-autocmd*

View File

@ -142,11 +142,8 @@ let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
" This flag can be set to 0 to disable echoing when the cursor moves.
let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
" String format for statusline
" Its a list where:
" * The 1st element is for errors
" * The 2nd element is for warnings
" * The 3rd element is when there are no errors
" A deprecated setting for ale#statusline#Status()
" See :help ale#statusline#Count() for getting status reports.
let g:ale_statusline_format = get(g:, 'ale_statusline_format',
\ ['%d error(s)', '%d warning(s)', 'OK']
\)