Do not override fold_char and use fold_char x for tests
This commit is contained in:
@@ -108,18 +108,17 @@ setlocal foldtext=TodoFoldText()
|
|||||||
|
|
||||||
" Go to first completed task
|
" Go to first completed task
|
||||||
let oldpos=getcurpos()
|
let oldpos=getcurpos()
|
||||||
let g:Todo_fold_char='@'
|
if(!exists("g:Todo_fold_char"))
|
||||||
let base_pos=search('^x\s', 'ce')
|
let g:Todo_fold_char='@'
|
||||||
" Get next completed task
|
let base_pos=search('^x\s', 'ce')
|
||||||
let first_incomplete = search('^\s*[^<x\s>]')
|
" Get next completed task
|
||||||
if (first_incomplete < base_pos)
|
let first_incomplete = search('^\s*[^<x\s>]')
|
||||||
|
if (first_incomplete < base_pos)
|
||||||
" Check if all tasks from
|
" Check if all tasks from
|
||||||
let g:Todo_fold_char='x'
|
let g:Todo_fold_char='x'
|
||||||
else
|
endif
|
||||||
" TODO detect if sorted on prjects
|
call setpos('.', oldpos)
|
||||||
let g:Todo_fold_char='@'
|
|
||||||
endif
|
endif
|
||||||
call setpos('.', oldpos)
|
|
||||||
|
|
||||||
function! s:get_contextproject(line) abort "{{{2
|
function! s:get_contextproject(line) abort "{{{2
|
||||||
return matchstr(getline(a:line), g:Todo_fold_char.'[^ ]\+')
|
return matchstr(getline(a:line), g:Todo_fold_char.'[^ ]\+')
|
||||||
@@ -156,7 +155,7 @@ function! TodoFoldText()
|
|||||||
" where N is the number of lines folded.
|
" where N is the number of lines folded.
|
||||||
return '+' . v:folddashes . ' '
|
return '+' . v:folddashes . ' '
|
||||||
\ . (v:foldend - v:foldstart + 1)
|
\ . (v:foldend - v:foldstart + 1)
|
||||||
\ .' '. this_context
|
\ .' '. this_context.' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Restore context {{{1
|
" Restore context {{{1
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ Execute (Clean up test environment):
|
|||||||
execute "silent! %substitute/" . s:duedate . "/**TODAY+2" . b:unit . "**/"
|
execute "silent! %substitute/" . s:duedate . "/**TODAY+2" . b:unit . "**/"
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
let g:Todo_fold_char='x'
|
||||||
|
|
||||||
Before:
|
Before:
|
||||||
After:
|
After:
|
||||||
|
|||||||
Reference in New Issue
Block a user