From 01c9a08982786c4508fea4893476935a553330fe Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 22 Mar 2020 00:07:05 +0100 Subject: Add repeat support Commands should be able to be repeated. Makes it easier to mark several to-dos complete in a row, for example. --- autoload/todo.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/autoload/todo.vim b/autoload/todo.vim index 8cfa986..070d3f5 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -4,6 +4,8 @@ function! todo#MarkComplete() keeppatterns s/\v^(\s*)[-_!xS] /\1v / call winrestview(view) + + silent! call repeat#set("\TwodoMarkComplete", v:count) endfunction @@ -13,6 +15,8 @@ function! todo#MarkDeleted() keeppatterns s/\v^(\s*)[-_!vS] /\1x / call winrestview(view) + + silent! call repeat#set("\TwodoMarkDeleted", v:count) endfunction @@ -22,6 +26,8 @@ function! todo#MarkPartiallyCompleted() keeppatterns s/\v^(\s*)[-_!xv] /\1S / call winrestview(view) + + silent! call repeat#set("\TwodoMarkPartiallyCompleted", v:count) endfunction @@ -31,6 +37,8 @@ function! todo#RemoveOldTodos() keeppatterns g/^\s*[vx] /d call winrestview(view) + + silent! call repeat#set("\TwodoRemoveOldTodos", v:count) endfunction @@ -49,6 +57,8 @@ function! todo#Escalate() endif call setline(line('.'), todo) + + silent! call repeat#set("\TwodoEscalate", v:count) endfunction @@ -67,4 +77,6 @@ function! todo#Descalate() endif call setline(line('.'), todo) + + silent! call repeat#set("\TwodoDescalate", v:count) endfunction -- cgit v1.2.3