-
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
Showing compiler output on non-continuous latexmk compile #2138
Comments
Ah, yes; I don't think it is unlikely that all of the VimTeX code has been rewritten since 2016. So it is quite likely that we need a new take on this to settle a good solution. Thanks for bringing it up!
I just want to remark that you can simplify the config. You only need to specify things you want to change. In this case, you can simplify to: let g:vimtex_compiler_latexmk = {'continuous' : 0}
I'm not sure if it is easy to show it live while it is compiling, but let's see how far we can come.
I think the proposed solution is close to what we want, but I am not surprised to find that it is deprecated. I made some updates, and the following should now work: let g:vimtex_compiler_latexmk = {'continuous' : 0}
augroup MyVimtex
au!
autocmd User VimtexEventCompileStarted call MyVimtexOutputter()
augroup END
function! MyVimtexOutputter()
VimtexCompileOutput
wincmd J
resize 20
wincmd w
endfunction |
It's not documented. I've updated my response; it is better to use the documented command |
Hi, I implemented the fix and there seems to be an error when compiling after the first time. I have recorded a video to show this. You will see the red error when compiling the second time and then the creation of the window in a separate buffer window. vimtex_compile.mp4 |
Sorry about that - it should be fixed now. |
Yup, that seems to fix it. So now the issue seems to be that the console mechanism does not play so nicely with the usual vimtex popup buffers. For example, running the compiler and then pressing The most sensible behaviour for people who want this functionality, I expect, is that a call to I suppose I am simply saying that the best outcome that would appeal to people would be a single console window at the bottom of the screen that handles both output and errors. |
I also found a weird bug. When using the output console functionality, you get massive slowdown when the window is open. I show this in the following video. I compile a document, and show the CPU usage spike when the new console window is open. Scrolling is very laggy. I then close the window and functionality returns to normal. vimtex_slow.mp4 |
I pushed an update that I think resolves your last issue. The idea was to avoid reloading the file if there is no new change. Please test. I'll look at the other part now. |
I believe the other problem is due to a race condition between the output window and the compiler callback. I've pushed a couple of fixes that should address it. To ensure the quickfix window appears on the bottom, you can close it first. I.e.: let g:vimtex_compiler_latexmk = {'continuous' : 0}
augroup MyVimtex
au!
autocmd User VimtexEventCompileStarted call MyVimtexOutputter()
augroup END
function! MyVimtexOutputter()
" Close quickfix window first
cclose
" Open output window
VimtexCompileOutput
wincmd J
resize 20
wincmd w
endfunction |
I've been using this solution quite a bit; appreciate the possibility of seeing perhaps primarily that something is happening, as well as, to a lesser degree, what is happening. I've added the following, to also automatically close the output window when the compilation is stopped: augroup MyVimtex " *Addition* to the augroup mentioned earlier in the thread
autocmd User VimtexEventCompileStopped call MyVimtexOutputterStop()
augroup END
function MyVimtexOutputterStop()
wincmd j
close
endfunction Not foolproof by any means, but it works as I want it to more often than not. |
Cool; thanks for sharing! |
This is related to the following issue: Displaying the results of a LaTeX run at the time which was asked, and to a certain extent resolved at the time in 2016. However, I don't think the resolution works anymore, perhaps due to changes since 2016.
I would like to:
Using vimtex in non-continuous mode, via,
When a file is compiled, I'd like to display the compiler output as it is outputted. This would be helpful in diagnosing errors that cause hangups in the compilers, or for large projects where compilation can take some time. This is the default behaviour in, e.g. SublimeText with LaTeXTools:
The resolution that was proposed was to use:
However, it suffers from two problems:
I get the error
I'm unable to find mention of
vimtex#latexmk#output
in the documentation.Also, according to the documentation
VimtexEventCompileStarted
only works with continuous mode set to on.The text was updated successfully, but these errors were encountered: