mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 06:35:28 +08:00
Move virtualtext handling to own file
This allows cursor and virtualtext to be independently autoloaded.
This commit is contained in:
@@ -452,3 +452,14 @@ function! ale#util#Col(str, chr) abort
|
||||
|
||||
return strlen(join(split(a:str, '\zs')[0:a:chr - 2], '')) + 1
|
||||
endfunction
|
||||
|
||||
function! ale#util#FindItemAtCursor(buffer) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
let l:loclist = get(l:info, 'loclist', [])
|
||||
let l:pos = getcurpos()
|
||||
let l:index = ale#util#BinarySearch(l:loclist, a:buffer, 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