-
Notifications
You must be signed in to change notification settings - Fork 387
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
Some problems with the TOC #22
Comments
I think the main problem here is related to the identification of the main file. I suspect that, for some reason, the main file is not detected in your case. This is as you describe in #16. To verify this, could you open the three files in the same vim session (use hidden buffers), then show me the output of |
If I open the three files by opening the main file first (i.e I first run However the problems appear if: i) I only open the ii) I open the three files but I first open a file other than the main file (i.e I run either |
Hi. First: Sorry that I'm taking so long on this. I'm on vacations, and I don't have that much time for vim-latex right now. Just so we're clear: Note also that the data blob allows several entries. This makes it possible to work with several latex projects at the same time. This is also the reason why the Now, I am not able to reproduce your issue. I suspect the issue might have something to do with windows, but I am not sure. It would be very helpful if you could try to look into it a little bit on your own. That is, I am relatively sure that the problem is with An "easy way out" would be for you to start using the |
This is strange. If I copy the
and run The problem is in fact
and change the last line of
to
Then |
When trying to find where is the problem related to the main file I think I also found another problem (at least with my settings). With the following minimal vimrc
If I open |
Changing to the current directory before searching for files that include the current file seems to solve the problem! iii) and iv) of my first post and the undefined variable problem of the last comment are still unsolved. If you want I can open a new issue (or two new issues) with those problems. Happy holidays btw! |
I would be happy if you could open new issues for iii) and iv). I think both of those can be solved relatively easily. Regarding your last comment, could you ensure that the filetype is |
Do you mean setting I think I'm not following your instructions properly. Sorry about that. Could explain them again? Note that this is something that doesn't affect my workflow at all, I just noticed it when using a minimal vimrc and thought it was worth mentioning. |
Sorry, my explanation was not good enough. I meant that you should add echomsg "Hello World" At the top of the function In the meantime I've realized that the problem is |
The problem only appear with a minimal vimrc like this (where
I added the Just forget about this, it is something that really doesn't affect my workflow at all. |
Thanks for adding the message indicating that "vim-latex has not been initialized!". |
Ah, actually, that is a good question. Actually, you should be able to initalize by calling In the mean time, it is interesting for me if we could understand WHY the plugin does not get initialized. Could you try to add some |
Changeset 89a47a0 moves default options to within |
Once again I'm probably not following you. I apologise for that. If the
the echo message is not displayed when using my minimal vimrc and opening a tex file (such as If I try to initialize vim-latex manually (using once again my minimal vimrc) by running Note once again that this doesn't affect my normal usage of the plugin. However I'm happy and willing to test any change that you desire to implement. |
Could you change if exists('g:latex_enabled') && !g:latex_enabled
echomsg 'g:latex_enabled is either undefined or off!'
finish
endif
if exists('b:did_ftplugin')
echomsg "Already did ftplugin"
finish
endif
let b:did_ftplugin = 1
echomsg "vim-latex is now enabled!"
call latex#init() This should explain why vim-atex is not initialized. As I already mentioned above, I suspect the main problem is that you didn't add However, it should have worked to manually initialize. Could the freeze be due to the get_main_recurse function? I just added a maxiter variable to prevent the while loop from being infinite. |
I''ll test this shortly (I'm a bit busy right now). In the meantime I think there is a typo in the maxiter variable. Can you check it? I've added a note to your commit. Thanks |
Changing With the maxiter variable (with the typo corrected) Vim doesn't freeze anymore and manual initialization works! In general (not only in my vimrc), do I need to set
? |
I think I finally understand what is happening here. First, you do NOT need to set set rtp += <some plugin> Instead of let &rtp = <some plugin> . &rtp Regarding the maxiter: I don't like that hack! I tried a different implementation of the while loop now, which works well on linux/unix. I would be happy if you could test it again on windows, and in particular on the example we're discussing in this thread. |
Thanks for the thorough explanation! The problem was indeed related to the way I was setting the rtp. The new implementation of the while loop works perfectly on Windows! Thanks for all the help and patience! I've have now switched full time to vim-latex. It is really awesome! |
Great! And thanks, I am very happy to hear that it works on windows and that you've made the switch. I'm also grateful for your input on how to improve the plugin! Keep it up! :) |
Happy to help. Sorry that I didn't try the latexmk functionality on Windows but I don't use it myself (I use a tool call arara to compile my documents). However I'm willing to test any other functionality on Windows. Just let me know. |
Great, I'll let you know! :) |
Maybe this sentence in the docs can now be updated?
|
Yes, indeed. |
Excellent. Thanks |
Great work on the new toc that doesn't need aux files! There are a few thing I noticed:
i) Consider the case where without generating aux files one has
a_main_file.tex
:where
bar.tex
isand
foo.tex
isIf for instance I call
latex#toc#toggle()
on eitherbar.tex
orfoo.tex
the TOC only shows the sections corresponding to each file and not both of them (maybe this is related to #16)ii) the first time I call
latex#toc#toggle()
from the main file it complains that it cannot read the included files like thisbut when called again it works
iii) if in the preamble I have some command that uses
\section{#1}
like:it shows in the TOC as a new section. Section commands in the preamble should be ignored.
iv) When I open the TOC I want focus to be in the TOC buffer (i.e place cursor there). Is there a way to achieve that?
The text was updated successfully, but these errors were encountered: