From 6d1d2d035adecffdb0926abc5c218e1cdb83b04b Mon Sep 17 00:00:00 2001 From: David Beniamine Date: Sun, 10 Sep 2017 12:13:10 +0200 Subject: [PATCH] Do not consider done tasks when sorting by due date --- autoload/todo.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/todo.vim b/autoload/todo.vim index f8fcb97..88a5e5e 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -169,7 +169,7 @@ endfunction function! todo#SortDue() " Check how many lines have a due:date on them let l:tasksWithDueDate = 0 - silent! %global/\v\c/let l:tasksWithDueDate += 1 + silent! %global/\v\c^[^x].*/let l:tasksWithDueDate += 1 if l:tasksWithDueDate == 0 " No tasks with a due:date: No need to modify the buffer at all " Also means we don't need to cater for no matches on searches below @@ -183,7 +183,7 @@ function! todo#SortDue() " Turn the due:date from due:yyyy-mm-dd to due:yyyymmdd so we can do a numeric sort silent! %substitute/\v<(due:\d{4})\-(\d{2})\-(\d{2})>/\1\2\3/ei " Sort all the lines with due: by numeric yyyymmdd, they will end up in ascending order at the bottom of the buffer - sort in /\