-
Notifications
You must be signed in to change notification settings - Fork 66
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
LaTeX-Box asks for "main LaTeX file" when not editing LaTeX files. #220
Comments
I'm curious: Does the same problem occur on my fork of LaTeX-Box? (There are substantial changes, but much of the code is still the same.) I can understand that this is VERY annoying! Edit: Fixed link. |
Is that the correct link? I get 404 this is not the web page you are looking for when I click that link. |
Could you check what file type the new buffer has? (Either with something like |
:set filetype reports filetype=txt |
That's very strange. The code you refer to should only run for |
I see you've edited the link, I've installed and tried your fork (ran :VimLatexCompile) and I did not have any problems. I will be using your fork from now on! |
It happens to me a lot too. I think that the common case is when I am editing a file in a project which is not a .tex file --- for example, if I open with gvim the two file BTW --- what should I change to use lervag's fork? I think that anyway it would be better to find the bug and fix it... ;-) |
Could you please describe exactly how to reproduce the bug? |
OK. So I start
After that, in the the garbage is from the usage of arrow keys when I do not notice the prompt. The two files are:
and
with a local latexmkrc which is:
and a global
About
and
Please feel free to ask for more info. Thanks. |
Ok, I think I understand what happens here: The I know a couple of things you can do to prevent this issue: First, you could name your main I think I will not try to implement a solution, unless someone sees a simple one. This is one of the main things I've "fixed" in my branch that I found too time intensive to backport. Fixed is quoted, since I ended up removing support for the |
Ok, I think I will try your branch. I do not see fancy to call all the main file the same ;-), and the comment thing could be nice but unfortunately the idea after including files is that they will be included from different main files... One thing: effectively, if I simply comment out the |
I think the Btw, I agree to your first comment, that the included files should not themselves generally specify where they are included. I've implemented a different strategy in my own branch where I instead search for files that have the current file included with |
Ok, found what happens. If I comment out the |
Yes. As said, the async mode will make latexmk call a function in vim to open the errorwindow if there are errors after compilation. This function requires the filename for the main tex file, and asks for it. |
Ok --- please bear with me, it may be that I am dense. So it is not possible to have the errorwindow shows up and NOT have the noxious "Enter main TeX file" prompt? Would it works with your version? Thanks! |
Correct: It is not possible to have the errorwindow show up without the "Enter main TeX file" prompt with LaTeX-Box at the moment in your specific example. The reason is that the function that opens the error file must first detect the main tex file. This is done in a function that tries several methods. The prompt is the final method, which means the first five methods failed, see here. Note that one method that is supported is to create an empty file called And yes, this should work as expected with my version. I might backport my method, but I don't have very much time lately. |
LaTeX-Box keeps asking to input the main LaTeX file even when you're not editing .tex, this is not only extremely annoying, but LaTeX box grabs keyboard input and won't let go until you kill vim.
Testcase:
At this point the following function is recursively called:
As you can see, the while loop does not end until you give it a .tex file, since the current working directory is not in a .tex project, you need to spend considerable effort to find a tex file just so you can make the loop stop! There is a b:main_tex_file variable checked by LaTeX-Box, however it is entirely useless as it's a buffer variable, as soon as you open a new buffer the variable is wiped!
This also sometimes happens when I quit vim with :q, before quitting this damn loop is called and won't shut down vim until I pick a .tex file, which is completely pointless as vim is going to shut down anyway!
Testcase2:
The most aggravating problem is that I do not understand what causes LaTeX-Box to call this function when I open a new buffer, there are no autocmds that do this, the only autocmd LaTeX-Box defines for non .tex files is in motion.vim and calls runtime plugin/matchparen.vim, which is harmless.
The text was updated successfully, but these errors were encountered: