Merge pull request #32 from naught101/prefixed_files

Allow prefixed files like blah.todo.txt. Fixes #29
This commit is contained in:
Leandro Freitas
2015-04-07 22:28:37 -03:00
2 changed files with 5 additions and 1 deletions

View File

@@ -6,5 +6,7 @@
" Version: 0.1
autocmd BufNewFile,BufRead [Tt]odo.txt set filetype=todo
autocmd BufNewFile,BufRead *.[Tt]odo.txt set filetype=todo
autocmd BufNewFile,BufRead [Dd]one.txt set filetype=todo
autocmd BufNewFile,BufRead *.[Dd]one.txt set filetype=todo

View File

@@ -52,8 +52,10 @@ endfunction
endfunction
function! TodoTxtRemoveCompleted()
" Check if we can write to done.txt before proceeding.
let l:target_dir = expand('%:p:h')
let l:target_dir = expand('%:p:h')
let l:todo_file = expand('%:p')
let l:done_file = substitute(substitute(l:todo_file, 'todo.txt$', 'done.txt', ''), 'Todo.txt$', 'Done.txt', '')
if !filewritable(l:done_file) && !filewritable(l:target_dir)
echoerr "Can't write to file 'done.txt'"