Use script local variable instead of buffer local

This commit is contained in:
EinfachToll 2015-02-02 10:35:32 +01:00
parent 13e76aed2e
commit de11957fca
4 changed files with 7 additions and 15 deletions

View File

@ -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

View File

@ -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 = '\$'

View File

@ -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 = '\$'

View File

@ -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 = '\$'