dc58db7640
The statusbar now keeps its state in a separate variable, in order to avoid excess iterations. The engine now updates said variable on run, and a new function is made available for external statusbars to call (to avoid dependencies on internal implementation details of ale). To keep things light, the status bar code is not loaded unless invoked by the user or an external plugin. On the first load it will update itself from the global loclist, after that, the engine will handle all updates. The external integration function, `ale#statusline#Count()`, will return a tuple in the format [E, W] (where E is errors, W is warnings), unless no data exists (ie, the plugin doesn't have a linter for a file or has not run yet), in which case it returns 0/false.
21 lines
634 B
VimL
21 lines
634 B
VimL
" Author: w0rp <devw0rp@gmail.com>
|
|
" Description: Utility functions related to cleaning state.
|
|
|
|
function! ale#cleanup#Buffer(buffer) abort
|
|
if has_key(g:ale_buffer_count_map, a:buffer)
|
|
call remove(g:ale_buffer_count_map, a:buffer)
|
|
endif
|
|
|
|
if has_key(g:ale_buffer_loclist_map, a:buffer)
|
|
call remove(g:ale_buffer_loclist_map, a:buffer)
|
|
endif
|
|
|
|
if has_key(g:ale_buffer_should_reset_map, a:buffer)
|
|
call remove(g:ale_buffer_should_reset_map, a:buffer)
|
|
endif
|
|
|
|
if has_key(g:ale_buffer_sign_dummy_map, a:buffer)
|
|
call remove(g:ale_buffer_sign_dummy_map, a:buffer)
|
|
endif
|
|
endfunction
|