File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,14 @@ endfunction
187187
188188" }}}1
189189function ! vimtex#compiler#start () abort " {{{1
190+ if b: vimtex .main_parser == # ' fallback current file'
191+ call vimtex#log#error (
192+ \ ' Compilation error due to failed mainfile detection!' ,
193+ \ ' Please ensure that VimTeX can locate the proper main .tex file.' ,
194+ \ ' Read ":help vimtex-multi-file" for more info.'
195+ \)
196+ return
197+ endif
190198 if b: vimtex .compiler .is_running ()
191199 call vimtex#log#warning (
192200 \ ' Compiler is already running for `' . b: vimtex .base . " '" )
Original file line number Diff line number Diff line change @@ -14,15 +14,15 @@ endfunction
1414
1515" }}}1
1616function ! vimtex#state#init () abort " {{{1
17- let [l: main , l: main_type ] = s: get_main ()
17+ let [l: main , l: main_parser ] = s: get_main ()
1818 let l: id = s: get_main_id (l: main )
1919
2020 if l: id >= 0
2121 let b: vimtex_id = l: id
2222 let b: vimtex = s: vimtex_states [l: id ]
2323 else
2424 let b: vimtex_id = s: vimtex_next_id
25- let b: vimtex = vimtex#state#class#new (l: main , l: main_type , 0 )
25+ let b: vimtex = vimtex#state#class#new (l: main , l: main_parser , 0 )
2626 let s: vimtex_next_id += 1
2727 let s: vimtex_states [b: vimtex_id ] = b: vimtex
2828 endif
@@ -268,7 +268,7 @@ function! s:get_main() abort " {{{1
268268 return [expand (' %:p' ), ' bib file' ]
269269 endif
270270 else
271- return [expand (' %:p' ), ' current file' ]
271+ return [expand (' %:p' ), ' fallback current file' ]
272272 endif
273273endfunction
274274
You can’t perform that action at this time.
0 commit comments