Skip to content

Commit

Permalink
Bugfix: Synctex does not work while using vscode in browser (#4220)
Browse files Browse the repository at this point in the history
* Bugfix syntex for code-server

Make synctex work in the code server environment

* Update latexworkshop.ts

typo

* Update latexworkshop.ts

---------

Co-authored-by: James Yu <[email protected]>
  • Loading branch information
wasalm and James-Yu committed Apr 10, 2024
1 parent 7452f88 commit a151957
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions viewer/latexworkshop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class LateXWorkshopPdfViewer implements ILatexWorkshopPdfViewer {
// - https://github.com/mozilla/pdf.js/pull/10318
private readonly webViewerLoaded: Promise<void> = new Promise((resolve) => {
document.addEventListener('webviewerloaded', () => resolve() )

// https://github.com/James-Yu/LaTeX-Workshop/pull/4220#issuecomment-2034520751
try {
parent.document.addEventListener('webviewerloaded', () => resolve() )
} catch(err) { /* do nothing */ }
})
private synctexEnabled = true
private autoReloadEnabled = true
Expand Down

0 comments on commit a151957

Please sign in to comment.