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

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

Merged

Conversation

rensbaardman
Copy link
Contributor

@rensbaardman rensbaardman commented Apr 24, 2020

There was ST1-syntax being used (the same as in #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:

  • reload the pdf on the same place if it was already opened
  • open the pdf on the first page if it hadn't been open

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

@r-stein
Copy link
Member

r-stein commented Apr 25, 2020

Thanks

Previously when compiling from a non-.tex file (such as a .sty
file in which you are working), compiling would be succesful,
but trying to view it would give an error that it was impossible
to jump from something else than a .tex-file.
This is true when trying to jump with a keybinding, but in a new
compilation, this should just open the PDF at the same page
it already was (or the first page if the PDF wasn't open).
This change fixes that by checking whether the command was invoked
from a keybinding or not.
@rensbaardman
Copy link
Contributor Author

@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
Copy link
Contributor

ig0774 commented Aug 24, 2021

@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
Copy link
Contributor Author

rensbaardman commented Aug 25, 2021

@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
Copy link
Contributor

ig0774 commented Aug 25, 2021

@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!

@ig0774 ig0774 merged commit b27fc39 into SublimeText:master Aug 25, 2021
hadisfr added a commit to hadisfr/LaTeXTools that referenced this pull request Sep 2, 2021
The combination of space and tab indentation in jumpToPDF.py -possibly appears in b27fc39 (merging SublimeText#1472)
prevents PDF viewer from opening after build, and removes View PDF and Jump to PDF commands from command list (See SublimeText#1539).
robfisc pushed a commit to robfisc/LaTeXTools that referenced this pull request Aug 30, 2022
robfisc pushed a commit to robfisc/LaTeXTools that referenced this pull request Aug 30, 2022
The combination of space and tab indentation in jumpToPDF.py -possibly appears in b27fc39 (merging SublimeText#1472)
prevents PDF viewer from opening after build, and removes View PDF and Jump to PDF commands from command list (See SublimeText#1539).
@kytta kytta mentioned this pull request Dec 29, 2022
59 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants