diff options
author | petpetpetpet <34608655+petpetpetpet@users.noreply.github.com> | 2019-01-27 12:44:49 +0000 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2019-01-27 12:44:49 +0000 |
commit | 3c38fdb1bb3625bcb222cfce16acd7db360ef413 (patch) | |
tree | a3953cca25d568a0cf4f39091a75b187812c47e6 /README.md | |
parent | a7b3b84899ba8752b4db91aff3b9a1b7a7a6fd83 (diff) | |
download | ale-3c38fdb1bb3625bcb222cfce16acd7db360ef413.zip |
Extend statusline interface (#2240)
* Extended statusline.vim to provide an efficient way to access the first errors,warnings,stylerrors,stylewarnings,etc from the loclist.
* Added documentation and help for the new API function.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -578,8 +578,16 @@ let g:airline#extensions#ale#enabled = 1 ``` If you don't want to use vim-airline, you can implement your own statusline -function without adding any other plugins. ALE provides a function for counting -the number of problems for this purpose, named `ale#statusline#Count`. +function without adding any other plugins. ALE provides some functions to +assist in this endeavour, including: + +* `ale#statusline#Count`: Which returns the number of problems found by ALE + for a specified buffer. +* `ale#statusline#FirstProblem`: Which returns a dictionary containing the + full loclist details of the first problem of a specified type found by ALE + in a buffer. (e.g. The first style warning in the current buffer.) + This can be useful for displaying more detailed information such as the + line number of the first problem in a file. Say you want to display all errors as one figure, and all non-errors as another figure. You can do the following: @@ -601,7 +609,8 @@ endfunction set statusline=%{LinterStatus()} ``` -See `:help ale#statusline#Count()` for more information. +See `:help ale#statusline#Count()` or `:help ale#statusline#FirstProblem()` +for more information. <a name="faq-lightline"></a> |