summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorDrew Neil <andrew.jr.neil@gmail.com>2017-06-03 12:45:52 +0100
committerw0rp <w0rp@users.noreply.github.com>2017-06-03 12:45:52 +0100
commit33b0852c84452afbaf0f41c2abc954008be7ef77 (patch)
tree89b405d4ec3237d6ee89a856493b137f777fa4ad /autoload
parentfcb57187126b0f0b8b176073a81911fd8ca3331a (diff)
downloadale-33b0852c84452afbaf0f41c2abc954008be7ef77.zip
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
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/loclist_jumping.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/autoload/ale/loclist_jumping.vim b/autoload/ale/loclist_jumping.vim
index 58fb8638..88ed4c97 100644
--- a/autoload/ale/loclist_jumping.vim
+++ b/autoload/ale/loclist_jumping.vim
@@ -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