Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VimTeX silently stop when document contain \errorstopmode command #2202

Closed
user202729 opened this issue Oct 10, 2021 · 5 comments
Closed

VimTeX silently stop when document contain \errorstopmode command #2202

user202729 opened this issue Oct 10, 2021 · 5 comments

Comments

@user202729
Copy link

user202729 commented Oct 10, 2021

(to the user, the issue could be obvious, but I just tried adding the command to test out some command-line compilation, then get back to VimTeX and was confused how it doesn't work. Still, it may be better if it raises some error \errorstopmode is not supported.)

To reproduce the issue:

Example document:

%! TEX program = xelatex
\documentclass{article}

\errorstopmode

\begin{document}

\undefinedcontrolsequence

text

\end{document}

Result: when compilation is started, there's a message "compilation started in continuous mode", then no more message.

@lervag
Copy link
Owner

lervag commented Oct 10, 2021

Well, I'm not entirely sure how VimTeX should react to this. I could perhaps search for the \errorstopmode command (and perhaps there are similar commands) and give a warning when starting to compile, but then, it seems entirely unnecessary to ever use that command?

@lervag
Copy link
Owner

lervag commented Oct 10, 2021

Note that adding the search for this command will add to the init processing and reduce performance. So I'm not convinced that it is worth the effort to do anything about it.

@lervag
Copy link
Owner

lervag commented Oct 10, 2021

VimTeX does not aim to be perfect. It aims to be pragmatic; good enough. We will never be able to handle every type of situation, and this situation seems unlikely and fully avoidable to me. But please, feel free to provide some more arguments why it makes sense to make a change.

@user202729
Copy link
Author

It's possible to change like this

--- a/autoload/vimtex/compiler/_template.vim
+++ b/autoload/vimtex/compiler/_template.vim
@@ -215,6 +215,7 @@ endfunction
 let s:compiler_jobs = {}
 function! s:compiler_jobs.exec(cmd) abort dict " {{{1
   let l:options = {
+        \ 'in_io' : 'null',
         \ 'out_io' : 'file',
         \ 'err_io' : 'file',
         \ 'out_name' : self.output,

This way the performance should not be affected, and it should also fix issues with other TeX files that wait for input on stdin for other reasons.

As far as I can see it does not have any negative side effect (is there any case where VimTeX send text to stdin of the subprocess?)

@lervag
Copy link
Owner

lervag commented Oct 11, 2021

It's possible to change like this ...

Yes, that seems safe. I'm pushing this (and similar for neovim) asap. Thanks for noticing this possibility and suggesting it!

@lervag lervag closed this as completed Oct 11, 2021
lervag added a commit that referenced this issue Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants