From d072d2654c68d1c0bf4a1cb8c15c31e989652669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Cavignac?= Date: Sun, 10 Feb 2019 12:11:29 +0100 Subject: 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 bindings with flags * Update documentation about ALENext and ALEPrevious * Use ale#args#Parse in JumpWrap --- plugin/ale.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'plugin/ale.vim') 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', ) +command! -bar -nargs=* ALENext +\ :call ale#loclist_jumping#WrapJump('after', ) + 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) " mappings for commands nnoremap (ale_previous) :ALEPrevious nnoremap (ale_previous_wrap) :ALEPreviousWrap +nnoremap (ale_previous_error) :ALEPrevious -error +nnoremap (ale_previous_wrap_error) :ALEPrevious -wrap -error +nnoremap (ale_previous_warning) :ALEPrevious -warning +nnoremap (ale_previous_wrap_warning) :ALEPrevious -wrap -warning nnoremap (ale_next) :ALENext nnoremap (ale_next_wrap) :ALENextWrap +nnoremap (ale_next_error) :ALENext -error +nnoremap (ale_next_wrap_error) :ALENext -wrap -error +nnoremap (ale_next_warning) :ALENext -warning +nnoremap (ale_next_wrap_warning) :ALENext -wrap -warning nnoremap (ale_first) :ALEFirst nnoremap (ale_last) :ALELast nnoremap (ale_toggle) :ALEToggle -- cgit v1.2.3