72 Commits

Author SHA1 Message Date
David Beniamine
5287e928fc Integrating sietse's work, version 0.7.6 2017-09-10 11:52:41 +02:00
Sietse Brouwer
57d45200c8 Enable vim-repeat for Done and Cancel 2017-08-08 11:09:22 +02:00
Rene Vergara
484c12771e Improve todo#PrependDate to follow format
Add logic to place the completion date after the priority, if it exists,
when completing a task.
2017-04-05 11:15:59 -05:00
David Beniamine
f77215ca80 Fix issue #11
Complete function assumed that a line started with x <date> or a
priority which is not necessarily true, thus some lines where ignored
from completion.
2017-03-30 18:57:18 +02:00
David Beniamine
849a7d5f61 Better way to put done at the end
+ Limit side effects
+ Sort done entries at the end
+ Work fine also without done entries
2016-11-25 11:26:44 +01:00
David Beniamine
0e2b110903 Merge remote-tracking branch 'dkarwowski/master' 2016-11-25 10:33:30 +01:00
David Beniamine
aad48b0231 Merge pull request #10 from victal/master
Fix overduedate regex breaking in November
2016-11-04 14:02:50 +01:00
Guilherme Victal
81e64682d0 Fix overduedate regex breaking in November 2016-11-04 09:46:42 -02:00
David Karwowski
303ab65237 priorities at top, x at bottom 2016-09-28 12:31:37 -04:00
David Beniamine
c2eb67f1a6 Version 0.7.5
No major changes, yet the merge with Fievel's work impacts considerably
the git tree thus a minor version update.
2016-09-05 15:46:52 +02:00
David Beniamine
85c215b4cc Use python3 if available
This commit incorporates [fievel's work](0863e1434e) to use python3 if possible.

I have not personally test vim+python3 but overdue dates still works with
python2.
2016-09-05 15:36:31 +02:00
David Beniamine
3e3251f8b5 Fievel work for python3 support 2016-09-05 15:26:03 +02:00
Florent Fievez
0863e1434e Vim distributed on recent linux distribution is now linked with
python3. Ensure compatibility with it.
2016-08-09 14:57:43 +02:00
David Beniamine
ca8ae307d3 removed error message if no python support 2016-05-20 19:46:48 +02:00
David Beniamine
95d97151c5 Remove unused files from freitass 2016-05-14 12:22:11 +02:00
Leandro Freitas
1e3a5e58ae Merge pull request #47 from colinsullivan/complete_all_grey
When tasks are completed, make the entire line grey.
2016-03-09 10:22:42 -03:00
Colin Sullivan
89570cbaef When tasks are completed, make the entire line grey. 2016-03-08 09:37:44 -08:00
Leandro Freitas
4548961329 Merge pull request #46 from rleon/fix-trailing-space
Fix wrong prefix for completed tasks
2016-01-28 14:33:29 -02:00
Leon Romanovsky
8dd24d0b68 Fix wrong prefix for completed tasks
The commit a612ebe ('Remove trailing whitespaces') removed the
whitespace which was after 'x' markup. It caused to mark the
completed task without space and didn't allow to remove it
automatically.

Before this change:
xCOMPLETION_DATE ....
After this change:
x COMPLETION_DATE ...

Fixes: a612ebe ('Remove trailing whitespaces')
Signed-off-by: Leon Romanovsky <leon@leon.nu>
2016-01-28 16:17:37 +02:00
Leandro Freitas
e2a02d4f30 Fix link to issue 2016-01-27 14:25:17 -02:00
Leandro Freitas
595fc0b49e Reinserted some of the trailing spaces
They were important for markdown formatting after all.
2016-01-27 14:24:22 -02:00
Leandro Freitas
a612ebeaf1 Remove trailing whitespaces 2016-01-27 14:09:17 -02:00
Leandro Freitas
17a2345675 Ignore .pyc files 2016-01-27 14:09:00 -02:00
Leandro Freitas
e13eb4bb9c Merge pull request #45 from victal/master
Syntax Highlight for overdue dates
2016-01-27 14:01:46 -02:00
Guilherme Victal
d769f12710 Embed dateregex instead of using a submodule 2016-01-27 11:01:57 -02:00
Guilherme Victal
2535cf2ece Remove dateregex submodule 2016-01-27 10:53:13 -02:00
Guilherme Victal
eb7f7cb8f4 Add plugin manager notice 2016-01-26 21:02:22 -02:00
Guilherme Victal
87a6c371dd Add Overdue Date group to (Z) tasks syntax match 2016-01-26 20:56:48 -02:00
Guilherme Victal
29a6ea4b1d Add description and license info 2016-01-26 10:29:37 -02:00
Guilherme Victal
03501dfe42 Remove test on syntax file 2016-01-26 09:32:10 -02:00
victal
fc0b4c3272 Update README with +python warning 2016-01-25 10:02:02 -02:00
Guilherme Victal
b87c7dd98d Correct .gitmodules file 2016-01-24 17:23:50 -02:00
Guilherme Victal
7232106f45 Move python scripts to syntax/ 2016-01-24 17:22:24 -02:00
Guilherme Victal
6e1bcc0e1a Overdue date syntax highlight 2016-01-24 16:57:01 -02:00
Guilherme Victal
03f5575363 Add syntax highlight for overdue dates 2016-01-22 22:09:20 -02:00
Leandro Freitas
b3d9e18b08 Merge pull request #43 from JonathanReeve/due-date
add ability to sort on due dates
2015-10-25 17:35:39 -02:00
Jonathan Reeve
a98711da91 add documentation for new feature 2015-10-25 14:54:25 -04:00
Jonathan Reeve
0a917143c5 sort by due date 2015-10-25 14:49:23 -04:00
Leandro Freitas
c13a277e2a Merge branch 'master' of https://github.com/freitass/todo.txt-vim 2015-08-03 14:22:57 -03:00
Leandro Freitas
421916b25d Fixes #42 2015-08-03 14:22:30 -03:00
Leandro Freitas
8da977113b Fixes 42 2015-08-03 14:21:49 -03:00
Leandro Freitas
2a04312e8d Merge pull request #40 from siddharthist/master
Clarified which files are considered todo.txt
2015-05-21 14:01:41 -03:00
siddharthist
85b2e86b73 Clarified which files are considered todo.txt 2015-05-21 10:39:33 -05:00
Leandro Freitas
1e465dd931 Fixes #39: Completion date replaces creation date. 2015-05-20 17:13:27 -03:00
Leandro Freitas
79e4d352a2 Renamed function to reflect its implementation 2015-05-20 17:12:46 -03:00
Leandro Freitas
ddbcdd823f fixup! Fixes #37. Inserting date on new tasks 2015-05-18 19:03:57 -03:00
Leandro Freitas
77cfafb9f0 Fixes #37. Inserting date on new tasks 2015-05-14 14:55:31 -03:00
Leandro Freitas
fbc45c5c8c Fixed README formatting 2015-05-06 16:59:44 -03:00
Leandro Freitas
6c5a37e6c6 Improved README 2015-05-06 16:50:08 -03:00
Leandro Freitas
25a63d5ecd Improved documentation 2015-05-06 16:39:14 -03:00
Leandro Freitas
04210abd70 Fixes #37. Replacing existing priority 2015-05-06 10:00:35 -03:00
Leandro Freitas
649f962211 Fixes #37. Replacing existing date 2015-05-06 09:47:04 -03:00
Leandro Freitas
b1ed8608d1 Fixes 'date' test 2015-05-05 09:52:28 -03:00
Leandro Freitas
f30ac979a1 Fixes 'mark as done' test 2015-05-05 09:50:50 -03:00
Leandro Freitas
40faa56012 Fixes #9 2015-05-05 09:37:02 -03:00
Leandro Freitas
51c821b5da Inserted date do note. 2015-04-22 10:31:31 -03:00
Leandro Freitas
6c073cdb42 Added note on mappings change. 2015-04-22 09:11:26 -03:00
Leandro Freitas
e508140f90 When sorting on date, tasks with no date go to the end. 2015-04-17 11:31:40 -03:00
Leandro Freitas
d0080e66f9 Testing functions only (not mappings). 2015-04-17 09:04:30 -03:00
Leandro Freitas
e071156b8d Fixes #16 2015-04-17 08:38:08 -03:00
Leandro Freitas
1f8b706d8e Fixes #28 2015-04-16 23:10:49 -03:00
Leandro Freitas
0e3c5cb2b6 Major refactoring 2015-04-16 22:56:09 -03:00
Leandro Freitas
32188000f9 Added documentation for sorting on dates. 2015-04-16 21:31:41 -03:00
Leandro Freitas
1cc11c56ad Sorting tasks by date. 2015-04-16 20:47:53 -03:00
Leandro Freitas
639fcd85a2 Implemented sorting on visual selection. 2015-04-16 20:25:58 -03:00
Leandro Freitas
b8a5bd64ca Testing date functions 2015-04-12 11:42:29 -03:00
Leandro Freitas
95ed508741 Added test cases for sorting and marking as done. 2015-04-11 11:28:33 -03:00
Leandro Freitas
05b5be07d2 Hopefully fixes #30 2015-04-11 11:25:28 -03:00
Leandro Freitas
08fcb4ccdb Merge branch 'master' of https://github.com/freitass/todo.txt-vim 2015-04-07 22:29:32 -03:00
Leandro Freitas
e817f5eca8 Merge pull request #32 from naught101/prefixed_files
Allow prefixed files like blah.todo.txt. Fixes #29
2015-04-07 22:28:37 -03:00
Leandro Freitas
2d83ed8dc2 Fixes #30 2015-04-07 21:49:51 -03:00
naught101
52e1527e9b allow prefixed files like blah.todo.txt 2015-04-07 22:55:42 +10:00
22 changed files with 67 additions and 310 deletions

0
.gitmodules vendored
View File

View File

@@ -28,17 +28,19 @@
## Release notes
v0.7.4 includes the overduedate support from Guilherme Victal (see pull
[request #45 on freitass version](https://github.com/freitass/todo.txt-vim/pull/45)),
it highlight dates in overdue tasks as an Error. It depends on a
Python library, however, and as such will only be able to work if your version
of Vim was compiled with the `+python` option (as most common versions do).
+ v0.7.6 Incorporates [Sietse's work](https://github.com/sietse/todo.txt-vim/commit/57d45200c8b033d31c9191ee0eb0711c801cdb1d) to make cancel and mark as done mapping repeatable using [vim-repeat](https://github.com/tpope/vim-repeat).
+ v0.7.5 Incorporates [Fievel's work](https://github.com/fievel/todo.txt-vim/commit/0863e1434e9a89ace06c4856b6cb32ba9906e3de) to make overduedates work on python3.
+ v0.7.4 includes the overduedate support from Guilherme Victal (see pull
If your Vim installation does **not** have Python support, this plugin **will work just fine** but this feature will be disabled.
[request #45 on freitass version](https://github.com/freitass/todo.txt-vim/pull/45)),
it highlight dates in overdue tasks as an Error. It depends on a
Python library, however, and as such will only be able to work if your version
of Vim was compiled with the `+python` option (as most common versions do).
If your Vim installation does **not** have Python support, this plugin **will work just fine** but this feature will be disabled.
Since v0.7.3, `TodoComplete` is replaced by `todo#Complete`, you might need to
update your vimrc (see [completion](#completion)).
+ Since v0.7.3, `TodoComplete` is replaced by `todo#Complete`, you might need to update your vimrc (see [completion](#completion)).
## Introduction

View File

@@ -62,7 +62,11 @@ function! todo#RemovePriority()
endfunction
function! todo#PrependDate()
if (getline(".") =~ '\v^\(')
execute "normal! 0f)a\<space>\<esc>l\"=strftime(\"%Y-%m-%d\")\<esc>P"
else
normal! 0"=strftime("%Y-%m-%d ")
P
endif
endfunction
@@ -137,9 +141,28 @@ function! todo#Sort()
silent! %s/\(x\s*\d\{4}\)-\(\d\{2}\)-\(\d\{2}\)/\1\2\3/g
sort n /^x\s*/
silent! %s/\(x\s*\d\{4}\)\(\d\{2}\)/\1-\2-/g
else
let oldcursor=getpos(".")
silent normal gg
let l:first=search('^\s*x')
if l:first != 0
sort /^./r
" at this point done tasks are at the end
let l:first=search('^\s*x')
let l:last=search('^\s*x','b')
let l:diff=l:last-l:first+1
" Cut the done lines
execute ':'.l:first.'d a '.l:diff
endif
sort /@[a-zA-Z]*/ r
sort /+[a-zA-Z]*/ r
sort /+[a-zA-Z]*/ r
sort /\v([A-Z])/ r
if l:first != 0
silent normal G"ap
execute ':'.l:first.','.l:last.'sort /@[a-zA-Z]*/ r'
execute ':'.l:first.','.l:last.'sort /+[a-zA-Z]*/ r'
execute ':'.l:first.','.l:last.'sort /\v([A-Z])/ r'
endif
call cursor(oldcursor)
endif
endfunction
@@ -331,7 +354,7 @@ fun! todo#Complete(findstart, base)
let res = []
for bufnr in range(1,bufnr('$'))
let lines=getbufline(bufnr,1,"$")
for line in lines
for line in lines
if line =~ " ".a:base
" init temporary item
let item={}

View File

@@ -31,6 +31,12 @@ Table of Contents *TodoTxt-Contents* ~
===============================================================================
1. Release notes *TodoTxt-ReleaseNotes* ~
v0.7.6 Incorporates [Sietse's work](https://github.com/sietse/todo.txt-vim/commit/57d45200c8b033d31c9191ee0eb0711c801cdb1d) to make cancel and mark as done mapping repeatable using [vim-repeat](https://github.com/tpope/vim-repeat).
v0.7.5 Incorporates Fievel's work
(https://github.com/fievel/todo.txt-vim/commit/0863e1434e9a89ace06c4856b6cb32ba9906e3de)
to make overduedates work on python3.
v0.7.4 includes the overduedate support from Guilherme Victal (see pull
request #45 on freitass version (https://github.com/freitass/todo.txt-vim/pull/45)),
it highlight dates in overdue tasks as an Error. It depends on a

View File

@@ -12,7 +12,7 @@ set cpo&vim
if exists("g:Todo_txt_loaded")
finish
else
let g:Todo_txt_loaded=0.7.4
let g:Todo_txt_loaded=0.7.6
endif
" General options {{{1
@@ -54,12 +54,15 @@ if !exists("g:Todo_txt_do_not_map")
noremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>
" Mark done {{{2
noremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone('')<CR>
noremap <script> <silent> <buffer> <Plug>DoToggleMarkAsDone :call todo#ToggleMarkAsDone('')<CR>
\:call repeat#set("\<Plug>DoToggleMarkAsDone")<CR>
nmap <localleader>x <Plug>DoToggleMarkAsDone
" noremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone('')<CR>
" Mark done {{{2
noremap <script> <silent> <buffer> <localleader>C :call todo#ToggleMarkAsDone('Cancelled')<CR>
noremap <script> <silent> <buffer> <Plug>DoCancel :call todo#ToggleMarkAsDone('Cancelled')<CR>
\:call repeat#set("\<Plug>DoCancel")<CR>
nmap <localleader>C <Plug>DoCancel
" Mark all done {{{2
noremap <script> <silent> <buffer> <localleader>X :call todo#MarkAllAsDone()<CR>

View File

@@ -7,5 +7,5 @@
# Website: http://github.com/freitass/todo.txt-vim
# Version: 0.1
from after import regex_date_after
from before import regex_date_before
from dateregex.after import regex_date_after
from dateregex.before import regex_date_before

View File

@@ -44,7 +44,7 @@ def _month_regex_before(year, month):
def _day_regex_before(year, month, day):
if day == '01':
return None
last_month_day = str((date(int(year), (int(month) + 1) % 12, 1) + - date.resolution).day)
last_month_day = str((date(int(year), int(month) % 12 + 1, 1) + - date.resolution).day)
last_digit1, last_digit2 = last_month_day
digit1, digit2 = day

View File

@@ -51,12 +51,12 @@ highlight default link TodoDate PreProc
highlight default link TodoProject Special
highlight default link TodoContext Special
if has('python')
let b:curdir = expand('<sfile>:p:h')
let s:script_dir = b:curdir . "/python/"
let b:curdir = expand('<sfile>:p:h')
let s:script_dir = b:curdir . "/python/"
if has('python3')
execute "py3file " . s:script_dir. "todo.py"
elseif has('python')
execute "pyfile " . s:script_dir. "todo.py"
else
echom "Your version of vim has no python support. Overdue dates won't be highlighted"
endif
let b:current_syntax = "todo"

View File

@@ -1,28 +0,0 @@
# lorem_ipsum
example task
# end_lorem_ipsum
# date_after_priority
(A) Call Mom
# end_date_after_priority
# date_after_priority_visual
(A) Call Mom
(B) Call Dad
# end_date_after_priority_visual
# existing_date_no_priority
2014-05-06 example task
# end_existing_date_no_priority
# existing_date_after_priority
(A) 2014-05-06 Call Mom
# end_existing_date_after_priority
# existing_date_do_nothing
2014-05-06 example task
# end_existing_date_do_nothing
# non_existing_date_do_nothing
new todo line
# end_non_existing_date_do_nothing

View File

@@ -1,84 +0,0 @@
let s:here = expand('<sfile>:p:h')
let s:context = todo#txt#__context__()
let s:context['data'] = s:here . '/tc_date.todo.txt'
let s:tc = unittest#testcase#new('Date', s:context)
let s:TODAY = strftime("%Y-%m-%d")
function! s:tc.test_current_date()
call self.assert_equal(s:TODAY, self.call('s:get_current_date', []))
endfunction
let s:DATE_INSERTED = [
\ s:TODAY . ' example task',
\ ]
let s:DATE_INSERTED_AFTER_PRIORITY = [
\ '(A) ' . s:TODAY . ' Call Mom',
\ ]
let s:DATE_INSERTED_AFTER_PRIORITY_VISUAL = [
\ '(A) ' . s:TODAY . ' Call Mom',
\ '(B) ' . s:TODAY . ' Call Dad',
\ ]
let s:DATE_INSERTED_DO_NOTHING = [
\ '2014-05-06 example task',
\ ]
let s:NON_EXISTING_DATE_INSERTED_DO_NOTHING = [
\ s:TODAY . ' new todo line',
\ ]
function! s:tc.test_insert_date_normal_mode()
call self.data.goto('lorem_ipsum')
call todo#txt#replace_date()
call self.assert_equal(s:DATE_INSERTED, self.data.get('lorem_ipsum'))
endfunction
function! s:tc.test_insert_date_insert_mode()
call self.data.goto('lorem_ipsum')
execute 'normal idate '
call self.assert_equal(s:DATE_INSERTED, self.data.get('lorem_ipsum'))
endfunction
function! s:tc.test_insert_date_visual_mode()
call self.data.visual_execute('call todo#txt#replace_date()', 'lorem_ipsum')
call self.assert_equal(s:DATE_INSERTED, self.data.get('lorem_ipsum'))
endfunction
function! s:tc.test_insert_date_after_priority_normal_mode()
call self.data.execute('call todo#txt#replace_date()', 'date_after_priority')
call self.assert_equal(s:DATE_INSERTED_AFTER_PRIORITY, self.data.get('date_after_priority'))
endfunction
function! s:tc.test_insert_date_after_priority_visual_mode()
call self.data.visual_execute('call todo#txt#replace_date()', 'date_after_priority_visual')
call self.assert_equal(s:DATE_INSERTED_AFTER_PRIORITY_VISUAL, self.data.get('date_after_priority_visual'))
endfunction
function! s:tc.test_insert_with_existing_date()
call self.data.execute('call todo#txt#replace_date()', 'existing_date_no_priority')
call self.assert_equal(s:DATE_INSERTED, self.data.get('existing_date_no_priority'))
endfunction
function! s:tc.test_insert_with_existing_date_and_priority()
call self.data.execute('call todo#txt#replace_date()', 'existing_date_after_priority')
call self.assert_equal(s:DATE_INSERTED_AFTER_PRIORITY, self.data.get('existing_date_after_priority'))
endfunction
function! s:tc.test_insert_with_existing_date_and_priority()
let g:todo_existing_date = 'n'
call self.data.execute('call todo#txt#replace_date()', 'existing_date_do_nothing')
call self.assert_equal(s:DATE_INSERTED_DO_NOTHING, self.data.get('existing_date_do_nothing'))
unlet g:todo_existing_date
endfunction
function! s:tc.test_insert_with_existing_date_and_priority()
let g:todo_existing_date = 'n'
call self.data.execute('call todo#txt#replace_date()', 'non_existing_date_do_nothing')
call self.assert_equal(s:NON_EXISTING_DATE_INSERTED_DO_NOTHING, self.data.get('non_existing_date_do_nothing'))
unlet g:todo_existing_date
endfunction
unlet s:tc

View File

@@ -1,5 +0,0 @@
# lorem_ipsum
first task to be marked as done
second task to be marked as done
2015-05-20 third task to be marked as done
# end_lorem_ipsum

View File

@@ -1,36 +0,0 @@
let s:here = expand('<sfile>:p:h')
let s:context = todo#txt#__context__()
let s:context['data'] = s:here . '/tc_mark_as_done.todo.txt'
let s:tc = unittest#testcase#new('Mark As Done', s:context)
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',
\ '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 . ' 2015-05-20 third task to be marked as done',
\ ]
function! s:tc.test_mark_as_done()
call self.data.goto('lorem_ipsum')
call todo#txt#mark_as_done()
call self.assert_equal(s:FIRST_TASK_DONE, self.data.get('lorem_ipsum'))
endfunction
function! s:tc.test_mark_range_as_done()
call self.data.execute('call todo#txt#mark_as_done()', 'lorem_ipsum')
call self.assert_equal(s:ALL_TASKS_DONE, self.data.get('lorem_ipsum'))
endfunction
function! s:tc.test_mark_selection_as_done()
call self.data.visual_execute('call todo#txt#mark_as_done()', 'lorem_ipsum')
call self.assert_equal(s:ALL_TASKS_DONE, self.data.get('lorem_ipsum'))
endfunction
unlet s:tc

View File

@@ -1,7 +0,0 @@
# insert_priority
example task
# end_insert_priority
# replace_priority
(A) example task
# end_replace_priority

View File

@@ -1,28 +0,0 @@
let s:here = expand('<sfile>:p:h')
let s:context = todo#txt#__context__()
let s:context['data'] = s:here . '/tc_priority.todo.txt'
let s:tc = unittest#testcase#new('Priority', s:context)
let s:TODAY = strftime("%Y-%m-%d")
let s:PRIORITY_INSERTED = [
\ '(A) example task',
\ ]
let s:PRIORITY_REPLACED = [
\ '(C) example task',
\ ]
function! s:tc.test_insert_priority()
call self.data.goto('insert_priority')
call todo#txt#prioritize_add('A')
call self.assert_equal(s:PRIORITY_INSERTED, self.data.get('insert_priority'))
endfunction
function! s:tc.test_replace_priority()
call self.data.goto('replace_priority')
call todo#txt#prioritize_add('C')
call self.assert_equal(s:PRIORITY_REPLACED, self.data.get('replace_priority'))
endfunction
unlet s:tc

View File

@@ -1,5 +0,0 @@
# lorem_ipsum
(B) Linear regression Rnet=Qh@Qle. @cons_emp_model
(B) Review key questions. @benchmarking
(A) simple model first @cons_emp_model
# end_lorem_ipsum

View File

@@ -1,18 +0,0 @@
let s:here = expand('<sfile>:p:h')
let s:tc = unittest#testcase#new('Sort Context',
\ { 'data': s:here . '/tc_sort_context.todo.txt' })
let s:LEADER = mapleader
let s:SORTED_TASKS = [
\ '(B) Review key questions. @benchmarking',
\ '(B) Linear regression Rnet=Qh@Qle. @cons_emp_model',
\ '(A) simple model first @cons_emp_model',
\ ]
function! s:tc.test_sort_by_context()
call self.data.visual_execute('call todo#txt#sort_by_context()', 'lorem_ipsum')
call self.assert_equal(s:SORTED_TASKS, self.data.get('lorem_ipsum'))
endfunction
unlet s:tc

View File

@@ -1,12 +0,0 @@
# lorem_ipsum
(B) 2013-03-15 2015-03-17
(B) 2012-04-16 2015-04-16
(A) 2013-03-16 2013-03-10
# end_lorem_ipsum
# task_with_no_date
2013-03-15 task with date
task with no date
2013-03-15 task with date
2013-03-15 task with date
task with no date
# end_task_with_no_date

View File

@@ -1,31 +0,0 @@
let s:here = expand('<sfile>:p:h')
let s:tc = unittest#testcase#new('Sort Date',
\ { 'data': s:here . '/tc_sort_date.todo.txt' })
let s:LEADER = mapleader
let s:SORTED_TASKS = [
\ '(B) 2012-04-16 2015-04-16',
\ '(B) 2013-03-15 2015-03-17',
\ '(A) 2013-03-16 2013-03-10',
\ ]
let s:SORTED_TASKS_WITH_NO_DATE = [
\ '2013-03-15 task with date',
\ '2013-03-15 task with date',
\ '2013-03-15 task with date',
\ 'task with no date',
\ 'task with no date',
\ ]
function! s:tc.test_sort_by_date()
call self.data.visual_execute('call todo#txt#sort_by_date()', 'lorem_ipsum')
call self.assert_equal(s:SORTED_TASKS, self.data.get('lorem_ipsum'))
endfunction
function! s:tc.test_sort_by_date_with_tasks_without_date()
call self.data.visual_execute('call todo#txt#sort_by_date()', 'task_with_no_date')
call self.assert_equal(s:SORTED_TASKS_WITH_NO_DATE, self.data.get('task_with_no_date'))
endfunction
unlet s:tc

View File

@@ -1,5 +0,0 @@
# lorem_ipsum
(B) Linear regression Rnet=Qh+Qle. +cons_emp_model
(B) Review key questions. +benchmarking
(A) simple model first +cons_emp_model
# end_lorem_ipsum

View File

@@ -1,18 +0,0 @@
let s:here = expand('<sfile>:p:h')
let s:tc = unittest#testcase#new('Sort Project',
\ { 'data': s:here . '/tc_sort_project.todo.txt' })
let s:LEADER = mapleader
let s:SORTED_TASKS = [
\ '(B) Review key questions. +benchmarking',
\ '(B) Linear regression Rnet=Qh+Qle. +cons_emp_model',
\ '(A) simple model first +cons_emp_model',
\ ]
function! s:tc.test_sort_by_project()
call self.data.visual_execute('call todo#txt#sort_by_project()', 'lorem_ipsum')
call self.assert_equal(s:SORTED_TASKS, self.data.get('lorem_ipsum'))
endfunction
unlet s:tc