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
Neovim gets Stuck when Continuous Compiling is started #1971
Comments
I believe the problem is related to these lines: vimtex/autoload/vimtex/view/zathura.vim Lines 52 to 56 in d99f8ff
Can you verify that by commenting this out or simply adding Note: Your minimal vimrc file seems not fully minimal to me. I would expect you can simplify it further: minimal.vim call plug#begin()
Plug 'lervag/vimtex'
call plug#end()
let g:vimtex_view_method = 'zathura' minimal.tex
Given the above, can you still reproduce with You should also note that these settings are not necessary ( let g:vimtex_compiler_progname = 'nvr'
let g:tex_flavor = "latex" |
return
for l:dummy in range(30)
let l:xwin_exists = self.xwin_exists()
if l:xwin_exists | break | endif
sleep 50m
endfor Adding a return just above the lines you mentioned did the trick. I tried just commenting, but received some errors because the code just after it used some variables declared inside the loop. I don't know exactly what this part should be doing, but if it won't break any other feature, I would consider it solved! Thank you so much for your fast response and solution, your plugin is awesome! |
Ah, no, it is not solved (unless you want to run your own fork). But I know where this happens, which is a start. :)
Happy to hear it! So, to continue the bug hunt: can you reproduce the issue with my minimal example? If so: which version of |
Hey. I have the same problem, it has been bothering me for some time now. I am using vim. Adding the Also: I am using X.org.
After opening a pdf in Zathura the output of
Thanks for the help and for the awesome plugin! |
Ok. Thanks for providing the additional information! Can you test again with the same set nocompatible
let &rtp = '~/.vim/bundle/vimtex,' . &rtp
filetype plugin on
let g:vimtex_view_method = 'zathura' In a terminal, do:
If I've understood correctly, this should reproduce the problem for you. Can you confirm? If so, then I'd be happy to do some debugging with your help to figure out what is wrong.
I'm glad you like it! |
So I am using vim-plug as my plugin manager, therefore your above set nocompatible
call plug#begin()
Plug 'lervag/vimtex'
call plug#end()
filetype plugin on
let g:vimtex_view_method = 'zathura' This should be equivalent to what you suggested, right?
That would be great! |
That's not right. The reason it did not work was because the runtime path was not right. I forgot to mention that: you need to update Note, this is not crucial, but since we are looking at a minimal example, there is no reason to also include vim-plug. Still, I understand that with the minimal example, you can still reproduce the issue (it might have been implied, but you did not state it explicitly)? |
Ok, this was it. Now my test.vim looks like this:
And vim still hangs for a couple of seconds then the forward search is still triggered after starting the compilation with |
Great, thanks. Now, can you edit
A simple editing loop is like this:
|
Here is what I found: After compilation is started with vimtex/autoload/vimtex/view/common.vim Lines 143 to 148 in 1fe16bf
Instead, this part is entered every time: vimtex/autoload/vimtex/view/common.vim Lines 153 to 160 in 1fe16bf
On line 154, l:pid will get a different positive value in every execution and so the conditional starting on line 155 is executed. Here however system(cmd) always returns empty. I also executed the contents of cmd in a separate terminal where it also returned nothing. This is the content of cmd (with a different PID in each of the 20-25 rapid executions):xdotool search --all --pid 572060 --name test.pdf I tried to look for running processes matching the value of l:pid but found none (I am not sure which process's ID self.get_id() should return here?). Finally, since system(cmd) always returns empty, the value of self.xwin_id is set to 0 zero on line 159 and the function returns false on line 176.
I hope this helps. |
Yes, actually, 30 times: vimtex/autoload/vimtex/view/zathura.vim Lines 52 to 56 in 1fe16bf
Thanks, that's very useful info! So, it seems the problem is related to a couple of calls, something like this:
We are looking for an already existing Zathura process, e.g. one started by I would be glad if you could test some of the above A variant: Do the same as above, but instead of opening Zathura manually, open it from VimTeX like this: i) open |
Both of your I echoed the vimtex/autoload/vimtex/view/zathura.vim Lines 133 to 135 in 1fe16bf
And the second attempt finds the 30 different but incorrect pids: vimtex/autoload/vimtex/view/zathura.vim Lines 138 to 141 in 1fe16bf
The command executed here is: pgrep -nf "zathura.+--servername VIM" .
How can this command find the correct pid when executed manually from a terminal but find different incorrect pids when executed by VimTeX? |
Great, thank you; we are getting close to the core, I think! Can you now do this:
|
The output of this command is:
The output of this command is a seven digit integer which is increasing slightly with each execution. I assume these are pids. |
Thanks; I've pushed an update now that I think might fix this issue. I've improved the |
See also #947 for an older relevant issue thread. |
This indeed solved the problem for me. Awesome, thanks for your kind help! |
Great, happy to hear it!
And thanks for testing things and helping me figure out where the problem was! |
Issue
When I turn the Continuous Compiling with
\ll
, my Neovim instance turns blank with a blinking cursor, and after a few seconds it comes back to normal at the same time the forward search indicator on Zathura is trigered.I noticed that if I put
on my init.vim, this behavior does not show up
nvim -u minimal.vim minimal.tex
minimal.vim
minimal.tex
Commands/Input
\ll
Observed Behaviour
I am attaching a video to showcase it, but as I stated above, my Nvim gets stuck in a blank background with a blinking cursor.
Expected Behaviour
As I start continuous compiling Zathura should start with no blocks
Output from VimtexInfo
githubIssue.mp4
The text was updated successfully, but these errors were encountered: