]> git.madduck.net Git - etc/vim.git/blob - autoload/ale/other_source.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / autoload / ale / other_source.vim
1 " Tell ALE that another source has started checking a buffer.
2 function! ale#other_source#StartChecking(buffer, linter_name) abort
3     call ale#engine#InitBufferInfo(a:buffer)
4     let l:list = g:ale_buffer_info[a:buffer].active_other_sources_list
5
6     call add(l:list, a:linter_name)
7     call uniq(sort(l:list))
8 endfunction
9
10 " Show some results, and stop checking a buffer.
11 " To clear results or cancel checking a buffer, an empty List can be given.
12 function! ale#other_source#ShowResults(buffer, linter_name, loclist) abort
13     call ale#engine#InitBufferInfo(a:buffer)
14     let l:info = g:ale_buffer_info[a:buffer]
15
16     " Remove this linter name from the active list.
17     let l:list = l:info.active_other_sources_list
18     call filter(l:list, 'v:val isnot# a:linter_name')
19
20     call ale#engine#HandleLoclist(a:linter_name, a:buffer, a:loclist, 1)
21 endfunction