LaTeXTools icon indicating copy to clipboard operation
LaTeXTools copied to clipboard

ST3: inverse search on evince triggers gedit instead of ST

Open henridb opened this issue 5 years ago • 4 comments

Hi,

I tried to understand this for a while, but no luck: On evince, the behavior of the ctrl+click is unstable. Some days, it will trigger the inverse search without any problem, other times, it doesn't work at all, but triggers the search on gedit.

I tried to do the suggestions from issue #791, and it sort of worked, but I could not pass the manual step: /bin/sh evince_sync python subl /path/to/pdffile.pdf works without any problem, so it would seem that the problem comes from LaTeXTools not creating the hook on launch, but I have no idea of how to fix this.

Thanks in advance !

henridb avatar Jun 08 '19 09:06 henridb

This behaviour is admittedly be default kind of fragile. Basically, we implement a DBus proxy that handles the on_sync_source event Evince generates. This is the exact same thing GEdit does (in fact, the code we use is a derivative of the GEdit code). I don't think there is any way we can say "prioritise this listener over that one", but I'll try to keep an eye out just in case.

ig0774 avatar Jul 26 '19 23:07 ig0774

Haaa, so it may be a solution to uninstall gedit? (this may be brutal but if it works...) Out maybe to disable the inverse search hook on gedit if it is possible. It's weird though, because sometimes, the inverse search doesn't work on ST even without launching gedit. It would mean that the hook is present all the time?

assombrance avatar Jul 27 '19 05:07 assombrance

Probably just disabling the Geist synctex plug-in is sufficient. I can’t remember how that’s done. That said, you’re right that there are other more intermittent issue with the Evince sync. I’m open to suggestions for how they might be solved.

ig0774 avatar Jul 27 '19 17:07 ig0774

Since then, I still have the problem. But I found a workaround that I'll post here in case it is useful for someone. To recall the problem, the forward sync sometimes works, sometimes doesn't. When it doesn't, I simply close evince, and enter

cd ~/.config/sublime-text/Packages/LaTeXTools/evince; \
nohup /bin/sh evince_sync python3 subl [path\to\document].pdf & exit

in a terminal This workaround works almost every time. If anyone has a better solution, it is still very welcome

assombrance avatar Aug 28 '21 07:08 assombrance