Do not override fold_char and use fold_char x for tests
This commit is contained in:
@@ -108,6 +108,7 @@ setlocal foldtext=TodoFoldText()
|
||||
|
||||
" Go to first completed task
|
||||
let oldpos=getcurpos()
|
||||
if(!exists("g:Todo_fold_char"))
|
||||
let g:Todo_fold_char='@'
|
||||
let base_pos=search('^x\s', 'ce')
|
||||
" Get next completed task
|
||||
@@ -115,11 +116,9 @@ 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
|
||||
let g:Todo_fold_char='@'
|
||||
endif
|
||||
call setpos('.', oldpos)
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user