Conforming to todo rules

Priorities must be uppercase
Completed task marker is lowercase
This commit is contained in:
David Beniamine
2017-09-12 16:38:41 +02:00
parent 7bebc01020
commit 774d4da4e9
2 changed files with 30 additions and 30 deletions

View File

@@ -31,11 +31,11 @@ endfunction
function! todo#txt#replace_date()
let current_line = getline('.')
if (current_line =~ '^\(([a-zA-Z]) \)\?\d\{2,4\}-\d\{2\}-\d\{2\} ') &&
if (current_line =~ '^\(([A-Z]) \)\?\d\{2,4\}-\d\{2\}-\d\{2\} ') &&
\ exists('g:todo_existing_date') && g:todo_existing_date == 'n'
return
endif
execute 's/^\(([a-zA-Z]) \)\?\(\d\{2,4\}-\d\{2\}-\d\{2\} \)\?/\1' . s:get_current_date() . ' /'
execute 's/^\(([A-Z]) \)\?\(\d\{2,4\}-\d\{2\}-\d\{2\} \)\?/\1' . s:get_current_date() . ' /'
endfunction
function! todo#txt#mark_as_done()
@@ -116,7 +116,7 @@ function! todo#txt#prioritize_add(priority)
endfunction
function! todo#txt#prioritize_add_action(priority)
execute 's/^\(([a-zA-Z]) \)\?/(' . a:priority . ') /'
execute 's/^\(([A-Z]) \)\?/(' . a:priority . ') /'
endfunction
" Modeline {{{1