aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-03-21 20:01:34 +0100
committerTeddy Wing2020-03-21 20:01:34 +0100
commitcb76590a7d75f9e49273b1f5ad7fbffaf3a0fd17 (patch)
tree5e04d64ddf99077da8a908794d1861c8378ff0c2
parent0fa59c30f1a6f5e1a9796e5df53c7cd955994509 (diff)
downloadvim-twodo-cb76590a7d75f9e49273b1f5ad7fbffaf3a0fd17.tar.bz2
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.
-rw-r--r--autoload/todo/motion.vim6
1 files 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