-
Notifications
You must be signed in to change notification settings - Fork 391
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
VimtexClean does not clean files (win10) #2139
Comments
That's definitely strange. Can you test this with a minimal example? I.e. use a minimal vimrc file and a minimal latex project. |
sure, will try it |
The same with minimal vimrc and tex file that are suggested in issue creation -- nothing is deleted. minimal.tex\documentclass{minimal}
\begin{document}
Hello world!
\end{document} min.vimrcset nocompatible
let &runtimepath = '~/vimfiles/pack/plug/start/vimtex,' . &runtimepath
let &runtimepath .= ',~/vimfiles/pack/plug/start/vimtex/after'
filetype plugin indent on
syntax enable
" Add relevant options and VimTeX configuration below.
let g:vimtex_compiler_latexrun_engines = {'_': 'lualatex'}
let g:vimtex_compiler_latexmk_engines = {'_': '-lualatex'}
let g:vimtex_compiler_latexmk = {
\ 'build_dir': {-> expand("%:t:r")},
\ 'options' : [
\ '-shell-escape',
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ ],
\}
let g:vimtex_syntax_packages = {'minted': {'load': 1}} vim start
If I remove |
Probably this is an issue :) function! s:compiler.clean(...) abort dict " {{{1
let l:files = ['synctex.gz', 'toc', 'out', 'aux', 'log']
" If a full clean is required
if a:0 > 0 && a:1
call extend(l:files, ['pdf'])
endif
call map(l:files, {_, x -> printf('%s/%s.%s',
\ self.build_dir, fnamemodify(self.target_path, ':t:r:S'), x)})
call vimtex#process#run('rm -f ' . join(l:files)) <------------------- `del /F` in widnows
call vimtex#log#info('Compiler clean finished')
endfunction Edit by @lervag: For reference, the above function is here: vimtex/autoload/vimtex/compiler/generic.vim Lines 90 to 104 in eb6bfd0
|
And for me it looks like this function is never called. I have put there some message, both with
I couldn't find definition of |
Very good; basing things on a minimal example makes it much simpler for me to help!
I would assume the issue persists without changing the set nocompatible
let &runtimepath = '~/vimfiles/pack/plug/start/vimtex,' . &runtimepath
let &runtimepath .= ',~/vimfiles/pack/plug/start/vimtex/after'
filetype plugin indent on
syntax enable
let g:vimtex_compiler_latexmk = {'build_dir': {-> expand("%:t:r")}}
Is this still true with the proposed minimal vimrc?
vimtex/autoload/vimtex/compiler/latexmk.vim Lines 349 to 372 in eb6bfd0
How did you find it? And with "it works", you mean it works when you run it in your own terminal? |
The command that is being used by vimtex is actually this one:
And if I run it from within my home directory (which I am in when I do clean up call for vimtex): It fails to actually goto the specified dir. |
You have the same problem also without the A major problem here is that I don't use Windows. I don't test on Windows. So it is very hard for me to fix issues like this. I've relied on help from the community to figure out how to fix and implement things on Windows. Still, as far as I know, there are several VimTeX users on Windows, so it is surprising if this is a problem even with a fully minimal example! It makes it appear to me that something that works for many people suddenly is not working for you. 😕 |
Yes indeed.
I can totally understand it, no problem here.
Or
While writing the last bullet -- it striked me -- I have always run Have just tried to run it from the same CWD -- it works! But looking at the source code and the command that should delete all the stuff, I can see it tries to goto the directory of the tex file to clean things up. It just fails to go there in the first place and latexmk then "cleans up" things from non tex file path. I have tried that command that Vimtex uses
on a cmd.exe and it fails with |
Next command works for me:
Note
|
Actually, existing command also works if you remove
Actual "as-of-now" command used by vimtex:
|
So, if I change these lines from
to
then |
@lervag could you tell me how can I tell vimtex that I want neither I don't want to create and sync my own fork only for this change :) PS, I am not sure what windows version would work with the command that is constructed in the end. |
Glad to hear that.
Yes, that might also be true.
Interesting!
Interesting, I'm glad that you are working on this and investigating!
Ok! I'm tempted to simply make that change. However, there's a small chance that it will break something. This worries me.
I don't believe there is a simple way to do that; sorry! Also, I would prefer to fix things instead of adding options, if that is possible.
Would you mind if I called your attention if, after making this change, someone reports an issue that seems related to this change? |
Sure, would be glad to help! |
Reading #1256, I get the impression that the fix implemented there was not really very well justified. So I'll revert it for now. If @vanabel or anyone else then has an issue similar to #1256, then I could help investigate it and perhaps also ask you to assist. So, with that: I'll push the change asap. |
Works like a charm now, thank you! |
Glad to hear it! |
Description
When I run
:VimtexClean
I can see cmd window running and after it is closed no files are deleted:Steps to reproduce
<localleader>ll
<localleader>ll
:VimtexClean
Expected behavior
All(?) or some generated files are deleted.
Actual behavior
Nothing is deleted.
Do you use a latexmkrc file?
No
VimtexInfo
The text was updated successfully, but these errors were encountered: