commit f48dce6f1d57246e05f0fc548a977e8136eb4ab4
parent 967b342b23f421d4d467b647d605f2c1577d4d04
Author: EinfachToll <istjanichtzufassen@googlemail.com>
Date: Wed, 14 Feb 2018 06:53:46 +0100
Refactor then updating of the known wiki pages
for the 'maxhi' option.
Diffstat:
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim
@@ -566,8 +566,6 @@ function! vimwiki#vars#get_bufferlocal(key, ...)
\ vimwiki#base#get_wiki_directories(vimwiki#vars#get_bufferlocal('wiki_nr')))
elseif a:key ==# 'prev_link'
call setbufvar(buffer, 'vimwiki_prev_link', [])
- elseif a:key ==# 'fs_rescan'
- call setbufvar(buffer, 'vimwiki_fs_rescan', 0)
elseif a:key ==# 'markdown_refs'
call setbufvar(buffer, 'vimwiki_markdown_refs', vimwiki#markdown_base#scan_reflinks())
else
diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim
@@ -61,17 +61,16 @@ function! s:setup_new_wiki_buffer() "{{{
endif
endif
+ if vimwiki#vars#get_wikilocal('maxhi')
+ call vimwiki#vars#set_bufferlocal('existing_wikifiles', vimwiki#base#get_wikilinks(wiki_nr, 1))
+ call vimwiki#vars#set_bufferlocal('existing_wikidirs',
+ \ vimwiki#base#get_wiki_directories(wiki_nr))
+ endif
+
" this makes that ftplugin/vimwiki.vim and afterwards syntax/vimwiki.vim are
" sourced
setfiletype vimwiki
- " to force a rescan of the filesystem which may have changed
- " and update VimwikiLinks syntax group that depends on it;
- " 'fs_rescan' indicates that setup_filetype() has not been run
- if vimwiki#vars#get_bufferlocal('fs_rescan') == 1 && vimwiki#vars#get_wikilocal('maxhi')
- set syntax=vimwiki
- endif
- call vimwiki#vars#set_bufferlocal('fs_rescan', 1)
endfunction "}}}
@@ -91,14 +90,6 @@ function! s:setup_buffer_enter() "{{{
if &filetype == ''
setfiletype vimwiki
- elseif &syntax ==? 'vimwiki'
- " to force a rescan of the filesystem which may have changed
- " and update VimwikiLinks syntax group that depends on it;
- " 'fs_rescan' indicates that setup_filetype() has not been run
- if vimwiki#vars#get_bufferlocal('fs_rescan') == 1 && vimwiki#vars#get_wikilocal('maxhi')
- set syntax=vimwiki
- endif
- call vimwiki#vars#set_bufferlocal('fs_rescan', 1)
endif
" The settings foldmethod, foldexpr and foldtext are local to window. Thus in