aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-03-21 19:44:44 +0100
committerTeddy Wing2020-03-21 19:44:44 +0100
commit0fa59c30f1a6f5e1a9796e5df53c7cd955994509 (patch)
treecbc4f26aa89a60b40b6fa0eec7c8cc81ca47a430
parent953c0b15706cb7f8cded7d6792e5031e2a78228f (diff)
downloadvim-twodo-0fa59c30f1a6f5e1a9796e5df53c7cd955994509.tar.bz2
Support counts in both `NextIncomplete()` and `PreviousIncomplete()`
-rw-r--r--autoload/todo/motion.vim12
1 files changed, 8 insertions, 4 deletions
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