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

Inconsistent pdf->source sync with symlink folder #1070

Closed
lucmos opened this issue Dec 16, 2018 · 9 comments
Closed

Inconsistent pdf->source sync with symlink folder #1070

lucmos opened this issue Dec 16, 2018 · 9 comments
Labels
enhancement Issue suggests an enhancement

Comments

@lucmos
Copy link

lucmos commented Dec 16, 2018

I have as workspace a symlink folder.
When I do ctrl + click to go from the pdf to the source, the file that is opened is the one with the real path.

e.g.
image

image

The problems:

The problem seems to appear even if I open the real folder in the workspace. Maybe the problem is that it is on a mount point?
On the notebook, where the folder is in ~/Documents I do not have this problem

@jlelong
Copy link
Collaborator

jlelong commented Dec 19, 2018

The problem is that synctex fully resolves symlinks during compilation and writes the resolved path in the .synctex.gz file. Not clear to me how we can handle the problem from the extension side. Don't we have to wait until vscode handles symlink properly?

Yet, I am a bit confused by

The problem seems to appear even if I open the real folder in the workspace. Maybe the problem is that it is on a mount point?

@tamuratak
Copy link
Contributor

I will look into this issue. Since any fix will conflict with my PR, #1030, please wait until the PR is merged.

@jlelong
Copy link
Collaborator

jlelong commented Dec 20, 2018

I just want to share my thoughts about this problem.

  • vscode's API does not give access to the list of opened editors: see the feature request.
  • In the extension, we keep track the tex file tree in Manager.texFileTree.
  • Before firing up a new editor from synctex, we could check whether a file from Manager.texFileTree resolves to the result of synctex.

Hope this will help.

@lucmos
Copy link
Author

lucmos commented Dec 20, 2018

Yet, I am a bit confused by

The problem seems to appear even if I open the real folder in the workspace. Maybe the problem is that it is on a mount point?

I'm confused too, since I don't seem to be able to reproduce the problem with a new, clean workspace. As I have time I'll try to do more tests

@jlelong
Copy link
Collaborator

jlelong commented Dec 23, 2018

@tamuratak I have just fixed this for Kpathsea/synctex but I am not sure what to do for synctexjs. Can you have a look.

@tamuratak
Copy link
Contributor

I can't reproduce this issue even without 8b5d00b.

Mac OS X: 10.13.6
VS Code: 1.30.1
LaTeX Workshop Version: 5.19.0

@jlelong
Copy link
Collaborator

jlelong commented Dec 24, 2018

I have managed to reproduce the issue with the following directory structure

top
  |-- dir1
  |      |-- main.tex
  |      |-- subfile.tex (called by main.tex via \include)
  |-- link-to-dir1

Run code -n link-to-dir1 and open main.tex. Then, compile and view. Call synctex from the PDF file at a position resolving to subfile.tex, it will open top/dir1/subfile.tex instead fo link-to-dir1/subfile.tex.

Not so easy to reproduce but it can be annoying. I hope 8b5d00b fixes this properly.

@tamuratak
Copy link
Contributor

Thank you, I can reproduce this issue now. I also confirm that 8b5d00b solves it.

@lucmos
Copy link
Author

lucmos commented Dec 24, 2018

So do I, I'm not experiencing the problem anymore!

Repository owner locked as resolved and limited conversation to collaborators Oct 12, 2021
@tamuratak tamuratak added the enhancement Issue suggests an enhancement label Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Issue suggests an enhancement
Projects
None yet
Development

No branches or pull requests

3 participants