fix: only ever spawn one changes consumer

This commit is contained in:
əlemi 2024-09-16 03:21:35 +02:00
parent 73b3c31ac1
commit 4bc05b1766
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -239,7 +239,10 @@ export async function attach(selected: vscode.TreeItem | undefined) {
});
}
});
let consuming = false;
buffer.callback(async (controller: codemp.BufferController) => {
if (consuming) return;
consuming = true;
while (true) {
let event = await controller.try_recv();
if (event === null) break;
@ -258,6 +261,7 @@ export async function attach(selected: vscode.TreeItem | undefined) {
locks.set(buffer_name, false);
}
consuming = false;
});
provider.refresh();
}