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

With multiple input files, preventing VimTeX from asking to choose main file each time a different input file is opened #2595

Closed
TryerGit opened this issue Dec 4, 2022 · 3 comments

Comments

@TryerGit
Copy link

TryerGit commented Dec 4, 2022

Hello,

Consider the following:

.vimrc:

if empty(glob('~/.vim/autoload/plug.vim'))
    silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
call plug#end()

let g:vimtex_quickfix_method = 'pplatex'

professor.tex and student.tex (both exactly same):

\documentclass{article}
\begin{document}
\input{main.tex} 
\end{document}

main.tex:

\input{section1.tex}
\input{section2.tex}

section1.tex

Purposely make an error: miss the closing dollar sign. 

$1 + 4 = 5

$1 != 4$

section2.tex

Open section2.tex directly via vim section2.tex

(Perhaps the above has one extra level of indirection? But in any case it was the minimal example I could come up with in this case)

Open section2.tex directly via vim section2.tex and choose professor.tex as the main file. Try to compile via \ll, pplatex correctly identifies the following error in section1.tex:

./section1.tex|4 error| Missing $ inserted <inserted text> $

When navigating to the quickfix list and pressing enter on this error, one is again presented with an option to choose the main file: professor.tex or student.tex

However, on my machine, neither of these two options are displayed. Please see attached animated gif:

genarr

On pressing enter twice, one is presented with a third "Press Enter or type command to continue" option. However, pressing enter does nothing here. On pressing Ctrl-C, there is an error:

Error detected while processing /home/TryerGit/.vim/plugged/vimtex/ftplugin/tex.vim:
line   25:
Interrupted

(Q1) It appears to me that on opening section2.tex and having chosen the main file as professor.tex, navigating to an error in section1.tex should not ask the user again to choose the main file -- it should automatically use professor.tex as the main file.

(Q2) Even if it is asked, the options don't seem to be displayed on my machine -- please see gif above.

Thank you.

lervag added a commit that referenced this issue Dec 4, 2022
@lervag
Copy link
Owner

lervag commented Dec 4, 2022

(Q1) It appears to me that on opening section2.tex and having chosen the main file as professor.tex, navigating to an error in section1.tex should not ask the user again to choose the main file -- it should automatically use professor.tex as the main file.

I agree, this was also the intent. Due to the well described issue report, I found a bug and fixed it, and I believe it may have been the cause of the problem here.

(Q2) Even if it is asked, the options don't seem to be displayed on my machine -- please see gif above.

Yes, in some cases, the menu's are not displayed properly. I believe this is mostly not an issue, e.g. in this case, I think I've fixed the real issue so the second menu does not appear.

However, it is true that the choice menus are not always reliably, and I have not found a very good way to solve that right now. In the meantime, I do think this should more or less not be a real problem.

@lervag lervag closed this as completed Dec 4, 2022
@TryerGit
Copy link
Author

TryerGit commented Dec 4, 2022

Thank you. :PlugUpdate vimtex and all is fine now :-)

@lervag
Copy link
Owner

lervag commented Dec 5, 2022

Glad to hear it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants