Bug fixes for case sensitivity and cursor positioning

This commit is contained in:
fretep
2017-09-14 00:27:03 +10:00
parent 0ed7d4848e
commit ff533b85f5
3 changed files with 36 additions and 34 deletions

View File

@@ -31,11 +31,11 @@ endfunction
function! todo#txt#replace_date()
let current_line = getline('.')
if (current_line =~ '^\(([a-zA-Z]) \)\?\d\{2,4\}-\d\{2\}-\d\{2\} ') &&
if (current_line =~ '^\(([A-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() . ' /'
execute 's/^\(([A-Z]) \)\?\(\d\{2,4\}-\d\{2\}-\d\{2\} \)\?/\1' . s:get_current_date() . ' /'
endfunction
function! todo#txt#mark_as_done()
@@ -116,7 +116,7 @@ function! todo#txt#prioritize_add(priority)
endfunction
function! todo#txt#prioritize_add_action(priority)
execute 's/^\(([a-zA-Z]) \)\?/(' . a:priority . ') /'
execute 's/^\(([A-Z]) \)\?/(' . a:priority . ') /'
endfunction
" Modeline {{{1