Fixes #37. Inserting date on new tasks

This commit is contained in:
Leandro Freitas
2015-05-14 14:55:31 -03:00
parent fbc45c5c8c
commit 77cfafb9f0
3 changed files with 18 additions and 1 deletions

View File

@@ -26,7 +26,9 @@ function! s:get_current_date()
endfunction
function! todo#txt#prepend_date()
if exists('g:todo_existing_date') && g:todo_existing_date == 'n'
let current_line = getline('.')
if (current_line =~ '^\(([a-zA-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() . ' /'