From cb76590a7d75f9e49273b1f5ad7fbffaf3a0fd17 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 21 Mar 2020 20:01:34 +0100 Subject: motion.vim/s:Incomplete(): Use `s` search flag to mark Learned that `search()` accepts an `s` flag to mark the previous cursor location, so figured we should take advantage of that and remove the manual mark line. --- autoload/todo/motion.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/todo/motion.vim b/autoload/todo/motion.vim index 27d6264..32a7c88 100644 --- a/autoload/todo/motion.vim +++ b/autoload/todo/motion.vim @@ -1,14 +1,14 @@ let s:INCOMPLETE_MATCHER = '^\s*[\-_!] ' -function! s:Incomplete(search_flags) +function! s:Incomplete(extra_search_flags) let cnt = v:count1 - normal! m' + let search_flags = 's' . a:extra_search_flags let i = 0 while i < cnt - call search(s:INCOMPLETE_MATCHER, a:search_flags) + call search(s:INCOMPLETE_MATCHER, search_flags) let i += 1 endwhile endfunction -- cgit v1.2.3