Skip to content

update example using VimtexClean upon quit#2012

Closed
postylem wants to merge 1 commit intolervag:masterfrom
postylem:patch-1
Closed

update example using VimtexClean upon quit#2012
postylem wants to merge 1 commit intolervag:masterfrom
postylem:patch-1

Conversation

@postylem
Copy link
Copy Markdown
Contributor

The example is using some outdated function (I think).
I wanted to get the behaviour described, and I got it using VimtexClean instead of call vimtex#compiler#clean(0) which didn't do anything (as I don't think that function exists?)

The example is using some outdated function (I think).
I wanted to get the behaviour described, and I got it using `VimtexClean` instead of `call vimtex#compiler#clean(0)` which didn't do anything (as I don't think that function exists?)
lervag added a commit that referenced this pull request Mar 29, 2021
@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 29, 2021

The example is using some outdated function (I think).
I wanted to get the behaviour described, and I got it using VimtexClean instead of call vimtex#compiler#clean(0) which didn't do anything (as I don't think that function exists?)

function! vimtex#compiler#clean(full) abort " {{{1
call b:vimtex.compiler.clean(a:full)
if empty(b:vimtex.compiler.build_dir) | return | endif
sleep 100m
" Remove auxilliary output directories if they are empty
let l:build_dir = (vimtex#paths#is_abs(b:vimtex.compiler.build_dir)
\ ? '' : b:vimtex.root . '/')
\ . b:vimtex.compiler.build_dir
let l:tree = glob(l:build_dir . '/**/*', 0, 1)
let l:files = filter(copy(l:tree), 'filereadable(v:val)')
if !empty(l:files) | return | endif
for l:dir in sort(l:tree) + [l:build_dir]
call delete(l:dir, 'd')
endfor
endfunction
" }}}1

The functions are not outdated and the both exist. The example is valid. However, I do agree it is probably better to refer to the already documented ex commands.

@lervag lervag closed this Mar 29, 2021
@postylem postylem deleted the patch-1 branch March 29, 2021 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants