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:
Drew Neil
2017-06-03 12:45:52 +01:00
committed by w0rp
parent fcb5718712
commit 33b0852c84
4 changed files with 47 additions and 2 deletions

View File

@@ -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