Fix #500: Improve support for import package

This commit is contained in:
Karl Yngve Lervåg 2016-07-31 00:13:50 +02:00
parent d733c249f6
commit ae3e32a8e2

View File

@ -9,7 +9,13 @@ endfunction
" }}}1
function! vimtex#parser#init_script() " {{{1
let s:input_line_tex = '\v^\s*\\%(input|include|subimport|subfile)\s*\{'
let s:input_line_tex = '\v^\s*\\%(' . join([
\ 'input',
\ 'include',
\ '%(sub)?import',
\ '%(sub)?%(input|include)from',
\ 'subfile',
\ ], '|') . ')\s*\{'
let s:input_line_aux = '\\@input{'
endfunction
@ -115,8 +121,8 @@ function! s:input_line_parser_tex(line, file, re) " {{{1
" Handle \space commands
let l:file = substitute(a:line, '\\space\s*', ' ', 'g')
" Hande subimport commands
if a:line =~# '\\subimport'
" Hande import package commands
if a:line =~# '\v\\%(sub)?%(import|%(input|include)from)'
let l:file = substitute(l:file, '}\s*{', '', 'g')
endif