Fixes #37. Replacing existing date

This commit is contained in:
Leandro Freitas
2015-05-06 09:47:04 -03:00
parent b1ed8608d1
commit 649f962211
4 changed files with 57 additions and 1 deletions

View File

@@ -26,7 +26,10 @@ function! s:get_current_date()
endfunction
function! todo#txt#prepend_date()
execute 's/^\(([a-zA-Z]) \)\?/\1' . s:get_current_date() . ' /'
if 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() . ' /'
endfunction
function! todo#txt#mark_as_done()