mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-11 11:23:47 -05:00
Merge pull request #32 from naught101/prefixed_files
Allow prefixed files like blah.todo.txt. Fixes #29
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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'"
|
||||
|
||||
Reference in New Issue
Block a user