From 49bdf7fa4754eca69426f63e41abf56c4b850b15 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Wed, 21 Dec 2016 21:28:48 +0100 Subject: [PATCH] Use new access functions for global variables -- part 2 Ref #256 --- autoload/vimwiki/base.vim | 4 +-- autoload/vimwiki/html.vim | 6 ++--- autoload/vimwiki/lst.vim | 2 +- ftplugin/vimwiki.vim | 14 +++++------ plugin/vimwiki.vim | 49 +++++++++++++------------------------ syntax/vimwiki.vim | 8 +++--- syntax/vimwiki_default.vim | 2 +- syntax/vimwiki_markdown.vim | 2 +- syntax/vimwiki_media.vim | 2 +- 9 files changed, 37 insertions(+), 52 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 53895bd..2d9ad96 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1771,7 +1771,7 @@ function! vimwiki#base#table_of_contents(create) endif let h_level = vimwiki#u#count_first_sym(line_content) let h_text = vimwiki#u#trim(matchstr(line_content, g:vimwiki_rxHeader)) - if h_text ==# g:vimwiki_toc_header " don't include the TOC's header itself + if h_text ==# vimwiki#vars#get_global('toc_header') " don't include the TOC's header itself continue endif let headers_levels[h_level-1] = [h_text, headers_levels[h_level-1][1]+1] @@ -1811,7 +1811,7 @@ function! vimwiki#base#table_of_contents(create) let links_rx = '\m^\s*'.vimwiki#u#escape(vimwiki#lst#default_symbol()).' ' - call vimwiki#base#update_listing_in_buffer(lines, g:vimwiki_toc_header, links_rx, + call vimwiki#base#update_listing_in_buffer(lines, vimwiki#vars#get_global('toc_header'), links_rx, \ 1, a:create) endfunction "}}} diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index b4aeed6..d2d81b9 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -157,7 +157,7 @@ function! s:delete_html_files(path) "{{{ let htmlfiles = split(glob(a:path.'**/*.html'), '\n') for fname in htmlfiles " ignore user html files, e.g. search.html,404.html - if stridx(g:vimwiki_user_htmls, fnamemodify(fname, ":t")) >= 0 + if stridx(vimwiki#vars#get_global('user_htmls'), fnamemodify(fname, ":t")) >= 0 continue endif @@ -933,7 +933,7 @@ function! s:process_tag_list(line, lists) "{{{ \ substitute(a:line, lstRegExp.'\%('.checkbox.'\)\?', '', '')) let processed = 1 elseif in_list && a:line =~# '^\s\+\S\+' - if g:vimwiki_list_ignore_newline + if vimwiki#vars#get_global('list_ignore_newline') call add(lines, a:line) else call add(lines, '
'.a:line) @@ -1005,7 +1005,7 @@ function! s:process_tag_h(line, id) "{{{ let h_id = s:safe_html_anchor(h_text) let centered = (a:line =~# '^\s') - if h_text !=# g:vimwiki_toc_header + if h_text !=# vimwiki#vars#get_global('toc_header') let a:id[h_level-1] = [h_text, a:id[h_level-1][1]+1] diff --git a/autoload/vimwiki/lst.vim b/autoload/vimwiki/lst.vim index ee465e4..8e295b6 100644 --- a/autoload/vimwiki/lst.vim +++ b/autoload/vimwiki/lst.vim @@ -1499,7 +1499,7 @@ function! vimwiki#lst#setup_marker_infos() "{{{ endif "the user can set the listsyms as string, but vimwiki needs a list - let g:vimwiki_listsyms_list = split(g:vimwiki_listsyms, '\zs') + let g:vimwiki_listsyms_list = split(vimwiki#vars#get_global('listsyms'), '\zs') endfunction "}}} function! vimwiki#lst#TO_list_item(inner, visual) "{{{ diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 76e190a..813118a 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -324,7 +324,7 @@ command! -buffer -nargs=* -complete=custom,vimwiki#tags#complete_tags " COMMANDS }}} " KEYBINDINGS {{{ -if g:vimwiki_use_mouse +if vimwiki#vars#get_global('use_mouse') nmap nmap nnoremap <2-LeftMouse> :call vimwiki#base#follow_link("nosplit", "\2-LeftMouse>") @@ -335,13 +335,13 @@ endif if !hasmapto('Vimwiki2HTML') - exe 'nmap '.g:vimwiki_map_prefix.'h Vimwiki2HTML' + exe 'nmap '.vimwiki#vars#get_global('map_prefix').'h Vimwiki2HTML' endif nnoremap