mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-23 02:23:07 +02:00
ftplugin: Avoid changing global viewoptions
As mentioned in an earlier commit, viewoptions is global, so it's probably best to override it only temporarily for mkview. (loadview is moved to autoload just for symmetry and in case we need to do something more complex, like saving/restoring foldmethod, later)
This commit is contained in:
parent
7b72ee47b9
commit
a6907bac85
2 changed files with 14 additions and 4 deletions
|
@ -1,6 +1,18 @@
|
|||
if exists('g:loaded_taskwiki_auto') | finish | endif
|
||||
let g:loaded_taskwiki_auto = 1
|
||||
|
||||
function! taskwiki#MkView() abort
|
||||
let viewoptions = &viewoptions
|
||||
set viewoptions-=options
|
||||
mkview
|
||||
let &viewoptions = viewoptions
|
||||
endfunction
|
||||
|
||||
function! taskwiki#LoadView() abort
|
||||
silent! loadview
|
||||
silent! doautocmd SessionLoadPost
|
||||
endfunction
|
||||
|
||||
function! taskwiki#FoldInit() abort
|
||||
" Unless vimwiki is configured to use its folding, set our own
|
||||
if &foldtext !~? 'VimwikiFold'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue