summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorThéo Cavignac <theo.cavignac@ecl16.ec-lyon.fr>2019-02-10 12:11:29 +0100
committerw0rp <w0rp@users.noreply.github.com>2019-02-10 11:11:29 +0000
commitd072d2654c68d1c0bf4a1cb8c15c31e989652669 (patch)
tree42747f3962720331f24cfabb5fa5c38abd203fd7 /plugin
parenta24f0b4d5f91f9214c64ae281fadcd981e0dadfc (diff)
downloadale-d072d2654c68d1c0bf4a1cb8c15c31e989652669.zip
Supporting filtered jump (#2279)
* Support filtered jump based on loclist item type (E or W for now) * Use flags to customize the behavior of ALENext and ALEPrevious * Update <plug> bindings with flags * Update documentation about ALENext and ALEPrevious * Use ale#args#Parse in JumpWrap
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale.vim15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugin/ale.vim b/plugin/ale.vim
index b2e6bf8c..1df473c5 100644
--- a/plugin/ale.vim
+++ b/plugin/ale.vim
@@ -151,9 +151,12 @@ if g:ale_completion_enabled
endif
" Define commands for moving through warnings and errors.
-command! -bar ALEPrevious :call ale#loclist_jumping#Jump('before', 0)
+command! -bar -nargs=* ALEPrevious
+\ :call ale#loclist_jumping#WrapJump('before', <q-args>)
+command! -bar -nargs=* ALENext
+\ :call ale#loclist_jumping#WrapJump('after', <q-args>)
+
command! -bar ALEPreviousWrap :call ale#loclist_jumping#Jump('before', 1)
-command! -bar ALENext :call ale#loclist_jumping#Jump('after', 0)
command! -bar ALENextWrap :call ale#loclist_jumping#Jump('after', 1)
command! -bar ALEFirst :call ale#loclist_jumping#JumpToIndex(0)
command! -bar ALELast :call ale#loclist_jumping#JumpToIndex(-1)
@@ -218,8 +221,16 @@ command! -bar ALEComplete :call ale#completion#AlwaysGetCompletions(0)
" <Plug> mappings for commands
nnoremap <silent> <Plug>(ale_previous) :ALEPrevious<Return>
nnoremap <silent> <Plug>(ale_previous_wrap) :ALEPreviousWrap<Return>
+nnoremap <silent> <Plug>(ale_previous_error) :ALEPrevious -error<Return>
+nnoremap <silent> <Plug>(ale_previous_wrap_error) :ALEPrevious -wrap -error<Return>
+nnoremap <silent> <Plug>(ale_previous_warning) :ALEPrevious -warning<Return>
+nnoremap <silent> <Plug>(ale_previous_wrap_warning) :ALEPrevious -wrap -warning<Return>
nnoremap <silent> <Plug>(ale_next) :ALENext<Return>
nnoremap <silent> <Plug>(ale_next_wrap) :ALENextWrap<Return>
+nnoremap <silent> <Plug>(ale_next_error) :ALENext -error<Return>
+nnoremap <silent> <Plug>(ale_next_wrap_error) :ALENext -wrap -error<Return>
+nnoremap <silent> <Plug>(ale_next_warning) :ALENext -warning<Return>
+nnoremap <silent> <Plug>(ale_next_wrap_warning) :ALENext -wrap -warning<Return>
nnoremap <silent> <Plug>(ale_first) :ALEFirst<Return>
nnoremap <silent> <Plug>(ale_last) :ALELast<Return>
nnoremap <silent> <Plug>(ale_toggle) :ALEToggle<Return>