Skip to content
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

Make mupdf viewer option auto-update #2676

Closed
user202729 opened this issue Mar 26, 2023 · 5 comments
Closed

Make mupdf viewer option auto-update #2676

user202729 opened this issue Mar 26, 2023 · 5 comments

Comments

@user202729
Copy link

user202729 commented Mar 26, 2023

Is your feature request related to a problem? Please describe it.
Currently if mupdf is used as a viewer, it will not automatically refresh when the PDF file change.

Describe the solution you'd like
Implement it. It can be done by sending HUP signal to the mupdf process https://unix.stackexchange.com/questions/425907/how-to-make-mupdf-automatically-refresh-a-document

At least just spawning kill -HUP <pid> work in UNIX environments, not sure about Windows.


Edit: we can use job_stop() in vim to signal SIGHUP, but still not sure if it works on Windows.

@lervag
Copy link
Owner

lervag commented Mar 26, 2023

Notice that this should work currently if you have xdotool:

call self.xdo_send_keys('r')

You are asking for an adjustment where we instead signal mupdf directly. It seems much less of a hack, and so I think it could be interesting to consider it.

To implement, we would need:

  1. Use vimtex#jobs#start to start the viewer, as that will use the modern jobstart or job_start apis and gives access to PIDs and possibly signalling.
  2. Either signal with kill -HUP PID or perhaps by use of built-in job_stop (there does not seem to be a corresponding version on neovim).

@user202729
Copy link
Author

Ah, for some reason it didn't work earlier (even though I have xdotool). I changed view method back to mupdf and it works now..

lervag added a commit that referenced this issue Mar 26, 2023
@lervag
Copy link
Owner

lervag commented Mar 26, 2023

I've made the changes now, and it seems to work well. Please test - does it work for you?

@lervag lervag closed this as completed Mar 26, 2023
@user202729
Copy link
Author

That's fast. Yes, it works.

@lervag
Copy link
Owner

lervag commented Mar 26, 2023

Great, glad to hear it. And thanks for the idea, I think this should be a general improvement overall for the mupdf layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants