File: tectonic.vim

package info (click to toggle)
vim-vimtex 2.17-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,844 kB
  • sloc: makefile: 360; python: 103
file content (49 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve LervÄg
" Email:      karl.yngve@gmail.com
"

function! vimtex#compiler#tectonic#init(options) abort " {{{1
  return s:compiler.new(a:options)
endfunction

" }}}1

let s:compiler = vimtex#compiler#_template#new({
      \ 'name' : 'tectonic',
      \ 'options' : [
      \   '--keep-logs',
      \   '--synctex'
      \ ],
      \})

function! s:compiler.__check_requirements() abort dict " {{{1
  if !executable('tectonic')
    call vimtex#log#warning('tectonic is not executable!')
    let self.enabled = v:false
  endif

  for l:opt in self.options
    if l:opt =~# '^-\%(o\|-outdir\)'
      call vimtex#log#warning("Don't use --outdir or -o in compiler options,"
            \ . ' use out_dir instead, see :help g:vimtex_compiler_tectonic'
            \ . ' for more details')
      break
    endif
  endfor
endfunction

" }}}1
function! s:compiler.__build_cmd(passed_options) abort dict " {{{1
  let l:outdir = !empty(self.out_dir)
        \ ? self.out_dir
        \ : self.file_info.root

  return 'tectonic ' . join(self.options)
        \ . ' --outdir="' . l:outdir . '"'
        \ . a:passed_options
        \ . ' ' . vimtex#util#shellescape(self.file_info.target_basename)
endfunction

" }}}1