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.
3 Save g:ale_set_quickfix
4 Save g:ale_loclist_msg_format
7 Save g:ale_set_lists_synchronously
9 let g:ale_set_lists_synchronously = 1
10 let g:ale_loclist_msg_format = '%code: %%s'
11 let g:ale_open_list = 0
13 let g:ale_buffer_info = {bufnr(''): {'loclist': g:loclist}}
15 function! AddItem(data) abort
21 \ 'linter_name': 'some_linter',
24 call add(g:loclist, extend(l:item, a:data))
31 unlet! b:ale_loclist_msg_format
35 call setloclist(0, [])
38 Execute(Formatting with codes should work for the loclist):
39 call AddItem({'text': "nocode\r"})
40 call ale#list#SetLists(bufnr(''), g:loclist)
56 \ ale#test#GetLoclistWithoutNewerKeys()
58 call remove(g:loclist, 0)
59 call AddItem({'text': 'withcode', 'code': 'E123'})
60 call ale#list#SetLists(bufnr(''), g:loclist)
73 \ 'text': 'E123: withcode',
76 \ ale#test#GetLoclistWithoutNewerKeys()
78 Execute(Formatting with codes should work for the quickfix list):
79 let g:ale_set_loclist = 0
80 let g:ale_set_quickfix = 1
82 call AddItem({'text': "nocode\r"})
83 call ale#list#SetLists(bufnr(''), g:loclist)
99 \ ale#test#GetQflistWithoutNewerKeys()
101 call remove(g:loclist, 0)
102 call AddItem({'text': 'withcode', 'code': 'E123'})
103 call ale#list#SetLists(bufnr(''), g:loclist)
109 \ 'bufnr': bufnr(''),
116 \ 'text': 'E123: withcode',
119 \ ale#test#GetQflistWithoutNewerKeys()
121 Execute(Formatting with the linter name should work for the loclist):
122 let g:ale_loclist_msg_format = '(%linter%) %s'
124 call AddItem({'text': 'whatever'})
125 call ale#list#SetLists(bufnr(''), g:loclist)
131 \ 'bufnr': bufnr(''),
138 \ 'text': '(some_linter) whatever',
141 \ ale#test#GetLoclistWithoutNewerKeys()
143 Execute(Formatting with the linter name should work for the quickfix list):
144 let g:ale_loclist_msg_format = '(%linter%) %s'
145 let g:ale_set_loclist = 0
146 let g:ale_set_quickfix = 1
148 call AddItem({'text': 'whatever'})
149 call ale#list#SetLists(bufnr(''), g:loclist)
155 \ 'bufnr': bufnr(''),
162 \ 'text': '(some_linter) whatever',
165 \ ale#test#GetQflistWithoutNewerKeys()
167 Execute(The buffer loclist format option should take precedence):
168 let g:ale_loclist_msg_format = '(%linter%) %s'
169 let b:ale_loclist_msg_format = 'FOO %s'
171 call AddItem({'text': 'whatever'})
172 call ale#list#SetLists(bufnr(''), g:loclist)
178 \ 'bufnr': bufnr(''),
185 \ 'text': 'FOO whatever',
188 \ ale#test#GetLoclistWithoutNewerKeys()