summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu Hernandez <manu@littlemousetrap.com>2020-03-12 10:25:23 +0000
committerDavid Beniamine <david.beniamine@tetras-libre.fr>2020-03-12 10:25:23 +0000
commit5585652ca6a768a809dc14a0e09f19b637b7a9cb (patch)
treeb5d1e43c62bb16c6f4637b2c88eca68de4b97cb7
parent11811d90a7693c8e92e5c00c36b4557d14b775a7 (diff)
downloadtodo.txt-vim-5585652ca6a768a809dc14a0e09f19b637b7a9cb.zip
Fix generation of [Dd]one-[Td]oday.txt files
-rw-r--r--autoload/todo.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/autoload/todo.vim b/autoload/todo.vim
index 74a54dd..c16cc52 100644
--- a/autoload/todo.vim
+++ b/autoload/todo.vim
@@ -144,7 +144,13 @@ function! todo#RemoveCompleted()
if exists("g:TodoTxtForceDoneName")
let l:done=g:TodoTxtForceDoneName
else
- let l:done=substitute(substitute(expand('%:t'),'todo','done',''),'Todo','Done','')
+ let l:currentfile=expand('%:t')
+
+ if l:currentfile =~ '[Tt]oday.txt'
+ let l:done=substitute(substitute(l:currentfile,'today','done-today',''),'Today','Done-Today','')
+ else
+ let l:done=substitute(substitute(l:currentfile,'todo','done',''),'Todo','Done','')
+ endif
endif
let l:done_file = l:target_dir.'/'.l:done
echo "Writing to ".l:done_file