vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit de11957fca64382209911815d2ed528aa8c02c1b
parent 13e76aed2e0588379bb56253e892b2cf3c184cb2
Author: EinfachToll <istjanichtzufassen@googlemail.com>
Date:   Mon,  2 Feb 2015 10:35:32 +0100

Use script local variable instead of buffer local

Diffstat:
Mautoload/vimwiki/html.vim | 13+++++++------
Msyntax/vimwiki_default.vim | 3---
Msyntax/vimwiki_markdown.vim | 3---
Msyntax/vimwiki_media.vim | 3---
4 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim @@ -768,10 +768,11 @@ function! s:process_tag_math(line, math) "{{{ let class = matchstr(a:line, '{{$\zs.*$') "FIXME class cannot be any string! let class = substitute(class, '\s\+$', '', 'g') - " Check the math placeholder (default: displaymath) - let b:vimwiki_mathEnv = matchstr(class, '^%\zs\S\+\ze%') - if b:vimwiki_mathEnv != "" - call add(lines, substitute(class, '^%\(\S\+\)%','\\begin{\1}', '')) + " store the environment name in a global variable in order to close the + " environment properly + let s:current_math_env = matchstr(class, '^%\zs\S\+\ze%') + if s:current_math_env != "" + call add(lines, substitute(class, '^%\(\S\+\)%','\\begin{\1}', '')) elseif class != "" call add(lines, "\\\[".class) else @@ -781,8 +782,8 @@ function! s:process_tag_math(line, math) "{{{ let processed = 1 elseif math[0] && a:line =~ '^\s*}}\$\s*$' let math = [0, 0] - if b:vimwiki_mathEnv != "" - call add(lines, "\\end{".b:vimwiki_mathEnv."}") + if s:current_math_env != "" + call add(lines, "\\end{".s:current_math_env."}") else call add(lines, "\\\]") endif diff --git a/syntax/vimwiki_default.vim b/syntax/vimwiki_default.vim @@ -4,9 +4,6 @@ " Author: Maxim Kim <habamax@gmail.com> " Home: http://code.google.com/p/vimwiki/ -" placeholder for math environments -let b:vimwiki_mathEnv = "" - " text: $ equation_inline $ let g:vimwiki_rxEqIn = '\$[^$`]\+\$' let g:vimwiki_char_eqin = '\$' diff --git a/syntax/vimwiki_markdown.vim b/syntax/vimwiki_markdown.vim @@ -4,9 +4,6 @@ " Author: Maxim Kim <habamax@gmail.com> " Home: http://code.google.com/p/vimwiki/ -" placeholder for math environments -let b:vimwiki_mathEnv = "" - " text: $ equation_inline $ let g:vimwiki_rxEqIn = '\$[^$`]\+\$' let g:vimwiki_char_eqin = '\$' diff --git a/syntax/vimwiki_media.vim b/syntax/vimwiki_media.vim @@ -4,9 +4,6 @@ " Author: Maxim Kim <habamax@gmail.com> " Home: http://code.google.com/p/vimwiki/ -" placeholder for math environments -let b:vimwiki_mathEnv = "" - " text: $ equation_inline $ let g:vimwiki_rxEqIn = '\$[^$`]\+\$' let g:vimwiki_char_eqin = '\$'