mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-02 09:33:31 +08:00
Fix #271 - Add the ability to open the quickfix or loclist windows only after saving a file
This commit is contained in:
@@ -50,10 +50,11 @@ function! ale#cursor#TruncatedEcho(message) abort
|
||||
endfunction
|
||||
|
||||
function! s:FindItemAtCursor() abort
|
||||
let l:info = get(g:ale_buffer_info, bufnr('%'), {'loclist': []})
|
||||
let l:info = get(g:ale_buffer_info, bufnr(''), {})
|
||||
let l:loclist = get(l:info, 'loclist', [])
|
||||
let l:pos = getcurpos()
|
||||
let l:index = ale#util#BinarySearch(l:info.loclist, l:pos[1], l:pos[2])
|
||||
let l:loc = l:index >= 0 ? l:info.loclist[l:index] : {}
|
||||
let l:index = ale#util#BinarySearch(l:loclist, l:pos[1], l:pos[2])
|
||||
let l:loc = l:index >= 0 ? l:loclist[l:index] : {}
|
||||
|
||||
return [l:info, l:loc]
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user