Skip to content

Commit

Permalink
fix: error in VimtexCompileSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Jan 8, 2021
1 parent d219436 commit 8725d47
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions autoload/vimtex/compiler.vim
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ endfunction

" }}}1
function! vimtex#compiler#compile_selected(type) abort range " {{{1
let l:file = vimtex#parser#selection_to_texfile(
\ {'type': a:type =~# 'line\|char\|block' ? 'operator' : a:type})
" Values of a:firstline and a:lastline are not available in nested function
" calls, so we must handle them here.
let l:opts = a:type ==# 'command'
\ ? {'type': 'range', 'range': [a:firstline, a:lastline]}
\ : {'type': a:type =~# 'line\|char\|block' ? 'operator' : a:type}

let l:file = vimtex#parser#selection_to_texfile(l:opts)
if empty(l:file) | return | endif

" Create and initialize temporary compiler
Expand Down

0 comments on commit 8725d47

Please sign in to comment.