#653 Set loclists better when taking data from previous buffers

This commit is contained in:
w0rp
2017-08-22 22:45:55 +01:00
parent 80c7fbcefe
commit 0507503aa7
2 changed files with 52 additions and 9 deletions

View File

@@ -728,7 +728,10 @@ function! s:AddProblemsFromOtherBuffers(buffer, linters) abort
if has_key(l:item, 'filename')
\&& l:item.filename is# l:filename
\&& has_key(l:name_map, l:item.linter_name)
call add(l:loclist, l:item)
" Copy the items and set the buffer numbers to this one.
let l:new_item = copy(l:item)
let l:new_item.bufnr = a:buffer
call add(l:loclist, l:new_item)
endif
endfor
endfor
@@ -737,6 +740,8 @@ function! s:AddProblemsFromOtherBuffers(buffer, linters) abort
call sort(l:loclist, function('ale#util#LocItemCompareWithText'))
call uniq(l:loclist, function('ale#util#LocItemCompareWithText'))
" Set the loclist variable, used by some parts of ALE.
let g:ale_buffer_info[a:buffer].loclist = l:loclist
call ale#engine#SetResults(a:buffer, l:loclist)
endif
endfunction