Skip to content

Commit

Permalink
Prevent .aux and .out file changes from triggering auto-build
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Apr 4, 2024
1 parent 88c83b2 commit 0483b31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compile/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function autoBuild(file: string, type: 'onFileChange' | 'onSave', bibChanged: bo
if (configuration.get('latex.autoBuild.run') as string !== type) {
return
}
logger.log('Auto build started' + (type === 'onFileChange' ? 'detecting the change of a file' : 'on saving file') + `: ${file} .`)
logger.log('Auto build started ' + (type === 'onFileChange' ? 'detecting the change of a file' : 'on saving file') + `: ${file} .`)
lw.event.fire(lw.event.AutoBuildInitiated, {type, file})
if (!canAutoBuild()) {
logger.log('Autobuild temporarily disabled.')
Expand Down
7 changes: 4 additions & 3 deletions src/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ async function loadFlsFile(filePath: string) {
// onWatchedFileChange.
continue
}
if (path.extname(inputFile) === '.tex') {
const inputExt = path.extname(inputFile)
if (inputExt === '.tex') {
if (get(filePath) === undefined) {
logger.log(`Cache not finished on ${filePath} when parsing fls, try re-cache.`)
await refreshCache(filePath)
Expand All @@ -466,8 +467,8 @@ async function loadFlsFile(filePath: string) {
} else {
logger.log(`Cache not finished on ${filePath} when parsing fls.`)
}
} else if (!lw.watcher.src.has(inputFile)) {
// Watch non-tex files.
} else if (!lw.watcher.src.has(inputFile) && !['.aux', '.out'].includes(inputExt)) {
// Watch non-tex files. aux and out are excluded because they are auto-generated during the building process
add(inputFile)
}
}
Expand Down

0 comments on commit 0483b31

Please sign in to comment.