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

Plugin scan through whole current directory when build_dir is nonempty #2198

Closed
user202729 opened this issue Oct 8, 2021 · 3 comments
Closed

Comments

@user202729
Copy link

user202729 commented Oct 8, 2021

In function s:compiler.create_build_dir(), if build_dir is not empty, the plugin scans through the whole directory that contains the TeX file.

(from my reading of the code, it's to create separate build dir for each folder that contain file or something similar)

This is very slow in some cases.

I think this can be safely disabled when g:vimtex_disable_recursive_main_file_detection is set, because the main file is always the current file.

@lervag
Copy link
Owner

lervag commented Oct 8, 2021

You're thinking about this line?

let l:dirs = split(glob(self.state.root . '/**/*.tex'), '\n')

Yes, the point is that if you use \include and similar, LaTeX will produce multiple aux files in the same tree hierarchy, and there will be an error if the output directory does not exist.

However, I realize there's a much better way to do this. VimTeX already parses the included files, so instead of globbing for all files, we can simply use this list. I'll fix and push asap.

@lervag
Copy link
Owner

lervag commented Oct 8, 2021

I think this can be safely disabled when g:vimtex_disable_recursive_main_file_detection is set, because the main file is always the current file.

Perhaps, but it feels much more as a hack, because the option is really not related to this code.

lervag added a commit that referenced this issue Oct 8, 2021
@lervag
Copy link
Owner

lervag commented Oct 8, 2021

Please test now.

@lervag lervag closed this as completed Oct 8, 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