mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-08 09:53:48 -05:00
Fixes #39: Completion date replaces creation date.
This commit is contained in:
@@ -25,6 +25,10 @@ function! s:get_current_date()
|
||||
return strftime('%Y-%m-%d')
|
||||
endfunction
|
||||
|
||||
function! todo#txt#prepend_date()
|
||||
execute 'normal! I' . s:get_current_date() . ' '
|
||||
endfunction
|
||||
|
||||
function! todo#txt#replace_date()
|
||||
let current_line = getline('.')
|
||||
if (current_line =~ '^\(([a-zA-Z]) \)\?\d\{2,4\}-\d\{2\}-\d\{2\} ') &&
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# lorem_ipsum
|
||||
first task to be marked as done
|
||||
second task to be marked as done
|
||||
third task to be marked as done
|
||||
2015-05-20 third task to be marked as done
|
||||
# end_lorem_ipsum
|
||||
|
||||
@@ -8,13 +8,13 @@ let s:TODAY = strftime("%Y-%m-%d")
|
||||
let s:FIRST_TASK_DONE = [
|
||||
\ 'x ' . s:TODAY . ' first task to be marked as done',
|
||||
\ 'second task to be marked as done',
|
||||
\ 'third task to be marked as done',
|
||||
\ '2015-05-20 third task to be marked as done',
|
||||
\ ]
|
||||
|
||||
let s:ALL_TASKS_DONE = [
|
||||
\ 'x ' . s:TODAY . ' first task to be marked as done',
|
||||
\ 'x ' . s:TODAY . ' second task to be marked as done',
|
||||
\ 'x ' . s:TODAY . ' third task to be marked as done',
|
||||
\ 'x ' . s:TODAY . ' 2015-05-20 third task to be marked as done',
|
||||
\ ]
|
||||
|
||||
function! s:tc.test_mark_as_done()
|
||||
|
||||
Reference in New Issue
Block a user