Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2eb67f1a6 | ||
|
|
85c215b4cc | ||
|
|
3e3251f8b5 | ||
|
|
0863e1434e | ||
|
|
ca8ae307d3 | ||
|
|
95d97151c5 | ||
|
|
1e3a5e58ae | ||
|
|
89570cbaef | ||
|
|
4548961329 | ||
|
|
8dd24d0b68 | ||
|
|
e2a02d4f30 | ||
|
|
595fc0b49e | ||
|
|
a612ebeaf1 | ||
|
|
17a2345675 | ||
|
|
e13eb4bb9c | ||
|
|
d769f12710 | ||
|
|
2535cf2ece | ||
|
|
eb7f7cb8f4 | ||
|
|
87a6c371dd | ||
|
|
29a6ea4b1d | ||
|
|
03501dfe42 | ||
|
|
fc0b4c3272 | ||
|
|
b87c7dd98d | ||
|
|
7232106f45 | ||
|
|
6e1bcc0e1a | ||
|
|
03f5575363 | ||
|
|
b3d9e18b08 | ||
|
|
a98711da91 | ||
|
|
0a917143c5 | ||
|
|
c13a277e2a | ||
|
|
421916b25d | ||
|
|
8da977113b | ||
|
|
2a04312e8d | ||
|
|
85b2e86b73 | ||
|
|
1e465dd931 | ||
|
|
79e4d352a2 | ||
|
|
ddbcdd823f | ||
|
|
77cfafb9f0 | ||
|
|
fbc45c5c8c | ||
|
|
6c5a37e6c6 | ||
|
|
25a63d5ecd | ||
|
|
04210abd70 | ||
|
|
649f962211 | ||
|
|
b1ed8608d1 | ||
|
|
f30ac979a1 | ||
|
|
40faa56012 | ||
|
|
51c821b5da | ||
|
|
6c073cdb42 | ||
|
|
e508140f90 | ||
|
|
d0080e66f9 | ||
|
|
e071156b8d | ||
|
|
1f8b706d8e | ||
|
|
0e3c5cb2b6 | ||
|
|
32188000f9 | ||
|
|
1cc11c56ad | ||
|
|
639fcd85a2 | ||
|
|
b8a5bd64ca | ||
|
|
95ed508741 | ||
|
|
05b5be07d2 | ||
|
|
08fcb4ccdb | ||
|
|
e817f5eca8 | ||
|
|
2d83ed8dc2 | ||
|
|
52e1527e9b |
0
.gitmodules
vendored
0
.gitmodules
vendored
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
## Release notes
|
## Release notes
|
||||||
|
|
||||||
|
v0.7.5 Incorporates [Fievel's work](https://github.com/fievel/todo.txt-vim/commit/0863e1434e9a89ace06c4856b6cb32ba9906e3de) to make overduedates work on python3. I have no version of vim with python3 thus it is only tested on his side, do not hesitate to report issues.
|
||||||
|
|
||||||
v0.7.4 includes the overduedate support from Guilherme Victal (see pull
|
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)),
|
[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
|
it highlight dates in overdue tasks as an Error. It depends on a
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ Table of Contents *TodoTxt-Contents* ~
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
1. Release notes *TodoTxt-ReleaseNotes* ~
|
1. Release notes *TodoTxt-ReleaseNotes* ~
|
||||||
|
|
||||||
|
v0.7.5 Incorporates Fievel's work
|
||||||
|
(https://github.com/fievel/todo.txt-vim/commit/0863e1434e9a89ace06c4856b6cb32ba9906e3de)
|
||||||
|
to make overduedates work on python3. I have no version of vim with python3
|
||||||
|
thus it is only tested on his side, do not hesitate to report issues.
|
||||||
|
|
||||||
v0.7.4 includes the overduedate support from Guilherme Victal (see pull
|
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)),
|
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
|
it highlight dates in overdue tasks as an Error. It depends on a
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ set cpo&vim
|
|||||||
if exists("g:Todo_txt_loaded")
|
if exists("g:Todo_txt_loaded")
|
||||||
finish
|
finish
|
||||||
else
|
else
|
||||||
let g:Todo_txt_loaded=0.7.4
|
let g:Todo_txt_loaded=0.7.5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" General options {{{1
|
" General options {{{1
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
# Website: http://github.com/freitass/todo.txt-vim
|
# Website: http://github.com/freitass/todo.txt-vim
|
||||||
# Version: 0.1
|
# Version: 0.1
|
||||||
|
|
||||||
from after import regex_date_after
|
from dateregex.after import regex_date_after
|
||||||
from before import regex_date_before
|
from dateregex.before import regex_date_before
|
||||||
|
|||||||
@@ -51,12 +51,12 @@ highlight default link TodoDate PreProc
|
|||||||
highlight default link TodoProject Special
|
highlight default link TodoProject Special
|
||||||
highlight default link TodoContext Special
|
highlight default link TodoContext Special
|
||||||
|
|
||||||
if has('python')
|
let b:curdir = expand('<sfile>:p:h')
|
||||||
let b:curdir = expand('<sfile>:p:h')
|
let s:script_dir = b:curdir . "/python/"
|
||||||
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"
|
execute "pyfile " . s:script_dir. "todo.py"
|
||||||
else
|
|
||||||
echom "Your version of vim has no python support. Overdue dates won't be highlighted"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "todo"
|
let b:current_syntax = "todo"
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# insert_priority
|
|
||||||
example task
|
|
||||||
# end_insert_priority
|
|
||||||
|
|
||||||
# replace_priority
|
|
||||||
(A) example task
|
|
||||||
# end_replace_priority
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user