Skip to content

Commit 9d60e10

Browse files
committed
Update documentIndex.ts
1 parent 5a2dc9f commit 9d60e10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/documentIndex.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ function generateCompileFn(): (doc: CurrentTextFile | CurrentBinaryFile) => void
8787
clearTimeout(timeout);
8888

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

0 commit comments

Comments
 (0)