-
Notifications
You must be signed in to change notification settings - Fork 407
An empty build_dir option makes :VimtexClean attempt to delete files from root directory / #2715
Copy link
Copy link
Closed
Labels
Description
Description
Continuing the discussion from #2677 (comment), steps to reproduce the issue are below.
Steps to reproduce
- Add the following to your
init.vim:
let g:vimtex_compiler_method = 'tectonic'
let g:vimtex_compiler_tectonic = {
\'build_dir' : '',
\'hooks' : [],
\'options' : [
\ '--keep-logs',
\ '--synctex',
\],
\}- Open a tex file.
- Compile it.
- Run
:!ls - Observe there are auxiliary files.
- Run
:VimtexClean - Run
:!lsagain - Observe no files were deleted.
A screencast is attached:
Also, I applied the following patch to debug this issue:
diff --git i/autoload/vimtex/compiler/_template.vim w/autoload/vimtex/compiler/_template.vim
index 8bd4b30b..b829297b 100644
--- i/autoload/vimtex/compiler/_template.vim
+++ w/autoload/vimtex/compiler/_template.vim
@@ -136,6 +136,7 @@ function! s:compiler.clean(full) abort dict " {{{1
call map(l:files, {_, x -> printf('%s/%s.%s',
\ self.build_dir, fnamemodify(self.state.tex, ':t:r:S'), x)})
+ call vimtex#jobs#run('echo files to be cleaned are: ' . join(l:files) . ' > /tmp/files-to-clean', {'cwd': self.state.root})
call vimtex#jobs#run('rm -f ' . join(l:files), {'cwd': self.state.root})
endfunction
And the /tmp/files-to-clean shows:
files to be cleaned are: /test.synctex.gz /test.toc /test.out /test.aux /test.log /test.xdv
Expected behavior
Auxiliary files are deleted.
Actual behavior
No auxiliary files are deleted.
Do you use a latexmkrc file?
No
VimtexInfo
System info:
OS: NixOS 23.05 (Stoat)
Vim version: NVIM v0.9.0
Has clientserver: true
Servername: /run/user/1000/nvim.1060012.0
VimTeX project: test
base: test.tex
root: /home/doron/desktop/init-tests/nvim/pack/testing/start/vimtex/test/test-doc
tex: /home/doron/desktop/init-tests/nvim/pack/testing/start/vimtex/test/test-doc/test.tex
main parser: current file verified
document class: article
packages: amsmath mathtools tikz
compiler: tectonic
options:
--keep-logs
--synctex
viewer: General
qf method: LaTeX logfileReactions are currently unavailable