diff options
Diffstat (limited to 'autoload/vimtex/parser/auxiliary.vim')
-rw-r--r-- | autoload/vimtex/parser/auxiliary.vim | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/autoload/vimtex/parser/auxiliary.vim b/autoload/vimtex/parser/auxiliary.vim deleted file mode 100644 index b8805ebd..00000000 --- a/autoload/vimtex/parser/auxiliary.vim +++ /dev/null @@ -1,58 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1 - -" vimtex - LaTeX plugin for Vim -" -" Maintainer: Karl Yngve LervÄg -" Email: karl.yngve@gmail.com -" - -function! vimtex#parser#auxiliary#parse(file) abort " {{{1 - return s:parse_recurse(a:file, []) -endfunction - -" }}}1 - -function! s:parse_recurse(file, parsed) abort " {{{1 - if !filereadable(a:file) || index(a:parsed, a:file) >= 0 - return [] - endif - call add(a:parsed, a:file) - - let l:lines = [] - for l:line in readfile(a:file) - call add(l:lines, l:line) - - if l:line =~# '\\@input{' - let l:file = s:input_line_parser(l:line, a:file) - call extend(l:lines, s:parse_recurse(l:file, a:parsed)) - endif - endfor - - return l:lines -endfunction - -" }}}1 - -function! s:input_line_parser(line, file) abort " {{{1 - let l:file = matchstr(a:line, '\\@input{\zs[^}]\+\ze}') - - " Remove extension to simplify the parsing (e.g. for "my file name".aux) - let l:file = substitute(l:file, '\.aux', '', '') - - " Trim whitespaces and quotes from beginning/end of string, append extension - let l:file = substitute(l:file, '^\(\s\|"\)*', '', '') - let l:file = substitute(l:file, '\(\s\|"\)*$', '', '') - let l:file .= '.aux' - - " Use absolute paths - if l:file !~# '\v^(\/|[A-Z]:)' - let l:file = fnamemodify(a:file, ':p:h') . '/' . l:file - endif - - " Only return filename if it is readable - return filereadable(l:file) ? l:file : '' -endfunction - -" }}}1 - -endif |