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 authored and w0rp committed 2017-06-03 12:45:52 +01:00
1 parent fcb5718712
commit 33b0852c84
4 files changed
+47 -2

No files matched your search

+13
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