Skip to content

Commit

Permalink
Modularize synctex
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Dec 11, 2023
1 parent 2e632f3 commit 10a025b
Show file tree
Hide file tree
Showing 10 changed files with 443 additions and 430 deletions.
2 changes: 1 addition & 1 deletion src/compile/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ async function afterSuccessfulBuilt(lastStep: Step, skipped: boolean) {
if (configuration.get('view.pdf.viewer') === 'external' && configuration.get('synctex.afterBuild.enabled')) {
const pdfFile = lw.file.getPdfPath(lastStep.rootFile)
logger.log('SyncTex after build invoked.')
lw.locator.syncTeX(undefined, undefined, pdfFile)
lw.locate.synctex.toPDF(undefined, undefined, pdfFile)
}
if (['onSucceeded', 'onBuilt'].includes(configuration.get('latex.autoClean.run') as string)) {
logger.log('Auto Clean invoked.')
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function synctex() {
} else if (lw.root.file.path !== undefined) {
pdfFile = lw.file.getPdfPath(lw.root.file.path)
}
lw.locator.syncTeX(undefined, undefined, pdfFile)
lw.locate.synctex.toPDF(undefined, undefined, pdfFile)
}

export function synctexonref(line: number, filePath: string) {
Expand All @@ -110,7 +110,7 @@ export function synctexonref(line: number, filePath: string) {
logger.log('Cannot start SyncTeX. The active editor is undefined, or the document is not a TeX document.')
return
}
lw.locator.syncTeXOnRef({line, filePath})
lw.locate.synctex.toPDFFromRef({line, filePath})
}

export async function clean(): Promise<void> {
Expand Down
5 changes: 5 additions & 0 deletions src/locate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { synctex } from './synctex'

export const locate = {
synctex
}
Loading

0 comments on commit 10a025b

Please sign in to comment.