Move get-known-sytaxes back into base.vim

This commit is contained in:
Ivan Tishchenko 2015-01-23 22:41:36 +03:00
parent 66626ad415
commit f5e1cbe721
2 changed files with 18 additions and 17 deletions

View File

@ -8,6 +8,23 @@ if exists("g:loaded_vimwiki_auto") || &cp
endif endif
let g:loaded_vimwiki_auto = 1 let g:loaded_vimwiki_auto = 1
" s:vimwiki_get_known_syntaxes
function! s:vimwiki_get_known_syntaxes() " {{{
" Getting all syntaxes that different wikis could have
let syntaxes = {}
let syntaxes['default'] = 1
for wiki in g:vimwiki_list
if has_key(wiki, 'syntax')
let syntaxes[wiki.syntax] = 1
endif
endfor
" append map g:vimwiki_ext2syntax
for syn in values(g:vimwiki_ext2syntax)
let syntaxes[syn] = 1
endfor
return keys(syntaxes)
endfunction " }}}
" vimwiki#base#apply_wiki_options " vimwiki#base#apply_wiki_options
function! vimwiki#base#apply_wiki_options(options) " {{{ Update the current function! vimwiki#base#apply_wiki_options(options) " {{{ Update the current
" wiki using the options dictionary " wiki using the options dictionary
@ -1905,7 +1922,7 @@ endfunction " }}}
" ------------------------------------------------------------------------- " -------------------------------------------------------------------------
" Load syntax-specific Wiki functionality " Load syntax-specific Wiki functionality
for s:syn in VimwikiGetKnownSyntaxes() for s:syn in s:vimwiki_get_known_syntaxes()
execute 'runtime! autoload/vimwiki/'.s:syn.'_base.vim' execute 'runtime! autoload/vimwiki/'.s:syn.'_base.vim'
endfor endfor
" ------------------------------------------------------------------------- " -------------------------------------------------------------------------

View File

@ -374,22 +374,6 @@ function! VimwikiGetKnownExtensions() " {{{
return keys(extensions) return keys(extensions)
endfunction " }}} endfunction " }}}
function! VimwikiGetKnownSyntaxes() " {{{
" Getting all syntaxes that different wikis could have
let syntaxes = {}
let syntaxes['default'] = 1
for wiki in g:vimwiki_list
if has_key(wiki, 'syntax')
let syntaxes[wiki.syntax] = 1
endif
endfor
" append map g:vimwiki_ext2syntax
for syn in values(g:vimwiki_ext2syntax)
let syntaxes[syn] = 1
endfor
return keys(syntaxes)
endfunction " }}}
" }}} " }}}
" CALLBACK functions "{{{ " CALLBACK functions "{{{