Skip to content

Commit

Permalink
Update documentIndex.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed Feb 4, 2025
1 parent 5a2dc9f commit 9d60e10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/documentIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ function generateCompileFn(): (doc: CurrentTextFile | CurrentBinaryFile) => void
clearTimeout(timeout);

// Compile right away if this document is in the active text editor
if (vscode.window.activeTextEditor?.document.uri.toString() == doc.uri.toString()) {
// and there are no other documents in the queue. This is needed
// to avoid noticeable latency when a user is editing a client-side
// file, saves it, and the auto-compile kicks in.
if (docs.length == 1 && vscode.window.activeTextEditor?.document.uri.toString() == doc.uri.toString()) {
compile([...docs]);
docs.length = 0;
return;
Expand Down

0 comments on commit 9d60e10

Please sign in to comment.