allow prefixed files like blah.todo.txt

This commit is contained in:
naught101
2015-04-07 22:55:42 +10:00
parent f07b2b2202
commit 52e1527e9b
2 changed files with 5 additions and 1 deletions

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'"