From 0fa59c30f1a6f5e1a9796e5df53c7cd955994509 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 21 Mar 2020 19:44:44 +0100 Subject: Support counts in both `NextIncomplete()` and `PreviousIncomplete()` --- autoload/todo/motion.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'autoload') diff --git a/autoload/todo/motion.vim b/autoload/todo/motion.vim index 96877a9..27d6264 100644 --- a/autoload/todo/motion.vim +++ b/autoload/todo/motion.vim @@ -1,20 +1,24 @@ let s:INCOMPLETE_MATCHER = '^\s*[\-_!] ' -function! todo#motion#NextIncomplete() +function! s:Incomplete(search_flags) let cnt = v:count1 normal! m' let i = 0 while i < cnt - call search(s:INCOMPLETE_MATCHER) + call search(s:INCOMPLETE_MATCHER, a:search_flags) let i += 1 endwhile endfunction +function! todo#motion#NextIncomplete() + call s:Incomplete('') +endfunction + + function! todo#motion#PreviousIncomplete() - normal! m' - call search(s:INCOMPLETE_MATCHER, 'b') + call s:Incomplete('b') endfunction -- cgit v1.2.3