Do not load whole syntax file for a buffer twice.

Load twice only regexes for a concrete syntax.
This commit is contained in:
Maxim Kim
2013-07-18 09:55:24 +04:00
parent 79b78dc9ee
commit 58e072fa92
6 changed files with 27 additions and 14 deletions

View File

@ -78,3 +78,13 @@ endfunction "}}}
function! vimwiki#u#escape(string) "{{{
return escape(a:string, '.*[]\^$')
endfunction "}}}
" Load concrete Wiki syntax: sets regexes and templates for headers and links
function vimwiki#u#reload_regexes() "{{{
execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim'
endfunction "}}}
" Load syntax-specific functionality
function vimwiki#u#reload_regexes_custom() "{{{
execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'_custom.vim'
endfunction "}}}