-
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
callback fails after compilation success or saving the .tex file #2386
Comments
It is impossible to answer your questions without more context.
It should work as before, I can't think of a reason why it should not.
You can check the release notes for some info, or read the git log. Perhaps you could try to do a git bisect on your side to find which commit breaks things for you?
You did not provide the test files. Do you mean these? set nocompatible
set runtimepath^=~/path/to/vimtex
set runtimepath+=~/path/to/vimtex/after
filetype plugin indent on
syntax enable
silent edit test.tex \documentclass{minimal}
\begin{document}
Hello World!
\end{document} Can you also provide the steps you use to reproduce? Preferably in full detail. Finally, after you do |
Thank you for your reply! set nocompatible
let &runtimepath = '~\AppData\Local\nvim-data\site\pack\packer\opt\vimtex,' . &runtimepath
let &runtimepath .= '~\AppData\Local\nvim-data\site\pack\packer\opt\vimtex\after,' . &runtimepath
filetype plugin indent on
syntax enable and \documentclass{minimal}
\begin{document}
Hello world!
\end{document} I begin the test in windows powershell using
and more, the output of typing
|
That's strange. Everything looks right... Can you repeat the test, but now with |
I have tried several commits, and callback fails since the commits on Apr 6, 2022, maybe the strict match to check callback type works wrong for encoding problem? |
oh, I forgot the link to the commit: b32c470 |
Did you test with the |
But OK, I see that you may be right that the specified commit affects this. Although it is still surprising. Perhaps it has to do with Windows vs unix stuff. Can you do some debugging in your end? I.e., first change the following code in your local vimtex repo: vimtex/autoload/vimtex/compiler/_template.vim Lines 454 to 464 in d8c1f71
to this: function! s:check_callback(line) abort " {{{1
if a:line =~# 'vimtex_compiler'
echom 'DBG: |' . a:line . '|'
endif
if a:line ==# 'vimtex_compiler_callback_compiling'
call vimtex#compiler#callback(1)
elseif a:line ==# 'vimtex_compiler_callback_success'
call vimtex#compiler#callback(2)
elseif a:line ==# 'vimtex_compiler_callback_failure'
call vimtex#compiler#callback(3)
endif
endfunction
" }}}1 The point is to inspect the input to the
Although the latter should not appear like that (because then things would work as expected). |
Ok, the option:
which may use encoding: |
Ah, yes, there it is. Thanks! I'll try to fix immediately. |
Sorry, I forgot to explain: the problem is related to |
I believe this should be resolved now. Please test. |
Sorry, but it still fails on my computer, I have updated the plugin, and tested it by using function! s:check_callback(line) abort " {{{1
let l:status = get(s:callbacks, substitute(a:line, "\n$", '', ''))
if a:line =~# 'vimtex_compiler'
echom 'DBG: |' . a:line . '|'
echom 'DBG: |' . substitute(a:line, "\n$", '', '') . '|'
echom 'DBG: |' . l:status . '|'
endif
if l:status <= 0 | return | endif
call vimtex#compiler#callback(l:status)
endfunction
let s:callbacks = {
\ 'vimtex_compiler_callback_compiling': 1,
\ 'vimtex_compiler_callback_success': 2,
\ 'vimtex_compiler_callback_failure': 3,
\}
" }}}1 It gave me the output:
|
Sorry, the regex was off. Try now. |
Ok, it works perfectly now, thank you! |
Glad to hear it! |
Description
Recently, I returned to write latex with vimtex, but I find I can't write latex with vimtex as before, because the callback doesn't work after compilation or saving the .tex file. I can callback mannually by
:echo vimtex#comiler#callback(2)
, but I prefer it can callback automatically, just like previous. What happened in the newest vimtex?I can reproduce the bug with example test file:
minimal.vim
andminimal.tex
.After compilation, when I can open minimal.pdf savely, the cmdline of neovim remains unchanged as show in image unless I type new commands in cmdline:
Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Do you use a latexmkrc file?
no
VimtexInfo
The text was updated successfully, but these errors were encountered: