diff options
| author | Teddy Wing | 2020-03-10 01:12:58 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2020-03-12 23:21:56 +0100 | 
| commit | a29a63f7ff3db981ae7fc38eace081ea4f2ad880 (patch) | |
| tree | 0cc764f649bd6ddbaa7ee4d22c0769126a556cec /bundle | |
| parent | df27c8e022078abf17b1eee3babec1d4be0c4b4a (diff) | |
| download | dotvim-a29a63f7ff3db981ae7fc38eace081ea4f2ad880.tar.bz2 | |
todo: Add count support to TODO movement commands
Diffstat (limited to 'bundle')
| -rw-r--r-- | bundle/todo/autoload/todo.vim | 18 | ||||
| -rw-r--r-- | bundle/todo/plugin/todo.vim | 4 | 
2 files changed, 16 insertions, 6 deletions
| diff --git a/bundle/todo/autoload/todo.vim b/bundle/todo/autoload/todo.vim index d5579c1..6885b2b 100644 --- a/bundle/todo/autoload/todo.vim +++ b/bundle/todo/autoload/todo.vim @@ -1,9 +1,19 @@ -function! todo#NextTODO() +function! s:MoveToTODO(search_flags) +	let cnt = v:count1  	normal! m' -	call search('TODO') + +	let i = 0 +	while i < cnt +		call search('TODO', a:search_flags) + +		let i += 1 +	endwhile +endfunction + +function! todo#NextTODO() +	call s:MoveToTODO('')  endfunction  function! todo#PreviousTODO() -	normal! m' -	call search('TODO', 'b') +	call s:MoveToTODO('b')  endfunction diff --git a/bundle/todo/plugin/todo.vim b/bundle/todo/plugin/todo.vim index a27171f..f4358a6 100644 --- a/bundle/todo/plugin/todo.vim +++ b/bundle/todo/plugin/todo.vim @@ -4,8 +4,8 @@ endif  let g:loaded_todo = 1 -nnoremap <silent> <Plug>(todo-previous) :call todo#PreviousTODO()<CR> -nnoremap <silent> <Plug>(todo-next) :call todo#NextTODO()<CR> +nnoremap <silent> <Plug>(todo-previous) :<C-u>call todo#PreviousTODO()<CR> +nnoremap <silent> <Plug>(todo-next) :<C-u>call todo#NextTODO()<CR>  if !hasmapto('<Plug>(todo-previous)', 'n') && !maparg('[t', 'n') | 
