mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-18 21:33:07 +02:00
syntax: Move setl foldtext to BufWinEnter autocmd
Vimwiki now resets fold{method,text} on BufWinEnter:8d4cb7f11d/plugin/vimwiki.vim (L177)
8d4cb7f11d/plugin/vimwiki.vim (L325)
so we should do that as well otherwise we get overridden. If the user actually configured vimwiki to use its folding, by setting g:vimwiki_folding to something else than '' or 'custom', we should not replace that. It would be nice if we could somehow augment VimwikiFoldText and leave the rest intact, but we can't, so it's best to keep off. Using foldmethod=syntax gets extremely laggy with just a few hundreds of lines, so we must not force it. Also, we now need to increase foldlevel in tests because the folding is no longer being overridden in the default vimwiki configuration, so we'd get closed folds in tests...
This commit is contained in:
parent
792ca80a2b
commit
7b72ee47b9
4 changed files with 12 additions and 4 deletions
|
@ -46,7 +46,10 @@ augroup taskwiki
|
|||
autocmd BufWinEnter <buffer> silent! loadview
|
||||
autocmd BufWinEnter <buffer> silent! doautocmd SessionLoadPost
|
||||
endif
|
||||
" Reset cache when switching buffers
|
||||
execute "autocmd BufEnter <buffer> :" . g:taskwiki_py . "cache.load_current().reset()"
|
||||
" Update window-local fold options
|
||||
autocmd BufWinEnter <buffer> call taskwiki#FoldInit()
|
||||
|
||||
" Refresh on load (if possible, after loadview to preserve folds)
|
||||
if has('patch-8.1.1113') || has('nvim-0.4.0')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue