Do not override fold_char and use fold_char x for tests

This commit is contained in:
David Beniamine
2018-04-19 23:45:09 +02:00
parent 7d70e30aae
commit 7b0262ae84
2 changed files with 11 additions and 11 deletions

View File

@@ -108,18 +108,17 @@ setlocal foldtext=TodoFoldText()
" Go to first completed task
let oldpos=getcurpos()
let g:Todo_fold_char='@'
let base_pos=search('^x\s', 'ce')
" Get next completed task
let first_incomplete = search('^\s*[^<x\s>]')
if (first_incomplete < base_pos)
" Check if all tasks from
let g:Todo_fold_char='x'
else
" TODO detect if sorted on prjects
if(!exists("g:Todo_fold_char"))
let g:Todo_fold_char='@'
let base_pos=search('^x\s', 'ce')
" Get next completed task
let first_incomplete = search('^\s*[^<x\s>]')
if (first_incomplete < base_pos)
" Check if all tasks from
let g:Todo_fold_char='x'
endif
call setpos('.', oldpos)
endif
call setpos('.', oldpos)
function! s:get_contextproject(line) abort "{{{2
return matchstr(getline(a:line), g:Todo_fold_char.'[^ ]\+')
@@ -156,7 +155,7 @@ function! TodoFoldText()
" where N is the number of lines folded.
return '+' . v:folddashes . ' '
\ . (v:foldend - v:foldstart + 1)
\ .' '. this_context
\ .' '. this_context.' '
endfunction
" Restore context {{{1

View File

@@ -15,6 +15,7 @@ Execute (Clean up test environment):
execute "silent! %substitute/" . s:duedate . "/**TODAY+2" . b:unit . "**/"
endfor
endfunction
let g:Todo_fold_char='x'
Before:
After: