SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 364 forks source link

Fix error message when jumping to pdf from non-.tex-file #1472

Closed rensbaardman closed 3 years ago

rensbaardman commented 4 years ago

There was ST1-syntax being used (the same as in https://github.com/SublimeText/LaTeXTools/issues/51) that caused a Python error. This PR fixes that, so when you are in a non-.tex-file and try to jump to the PDF, it gives the Sublime error "$FILE is not a TeX source file: cannot jump.".

This still leaves another question to me: I encountered this bug when I tried to recompile from a non-.tex-file. In that case, I think there should not be an error message, but instead it should either:

Should I open an issue for that? I am not familiar enough with the code base to fix it myself.

r-stein commented 4 years ago

Thanks

rensbaardman commented 4 years ago

@r-stein I actually did try to fix the open question I posed: see the new commits.

It solved my problem and I think this should work in all situations, but I'm not familiar enough with the code base to be completely sure. Could you review it?

ig0774 commented 3 years ago

@rensbaardman I think I might be willing to merge this, but it's awfully hard to follow what was actually changed in this PR. Could you point out the relevant lines if you remember?

rensbaardman commented 3 years ago

@ig0774 My apologies, looking back this is certainly not a clean PR, and I should have split up the cleaning and the fix. I was trying to do two things:

ig0774 commented 3 years ago

@rensbaardman That's fine... that sort of thing happens... made only more difficult by the pending refactors I've just merged in. I think the captures the import part. Thanks!