mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-08 21:15:18 +08:00
Add :ALEFirst and :ALELast commands (#616)
* Add :ALEFirst and :ALELast commands * Add documentation for ALEFirst and ALELast commands * Add tests for ale#loclist_jumping#JumpToIndex() * Fix the loclist jumping tests
This commit is contained in:
1 parent
fcb5718712
commit
33b0852c84
4 files changed
+47
-2
No files matched your search
@@ -64,3 +64,16 @@ function! ale#loclist_jumping#Jump(direction, wrap) abort
|
||||
call cursor(l:nearest)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#loclist_jumping#JumpToIndex(index) abort
|
||||
let l:info = get(g:ale_buffer_info, bufnr('%'), {'loclist': []})
|
||||
let l:loclist = l:info.loclist
|
||||
if empty(l:loclist)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:item = l:loclist[a:index]
|
||||
if !empty(l:item)
|
||||
call cursor([l:item.lnum, l:item.col])
|
||||
endif
|
||||
endfunction
|
||||
Reference in new issue
Block a user