From 2aa513cc989a04b420aee0428ca81935add037a9 Mon Sep 17 00:00:00 2001 From: frelodev Date: Sat, 26 Oct 2024 21:56:41 +0200 Subject: [PATCH] chore: format --- src/commands/buffers.ts | 2 +- src/commands/client.ts | 34 +++++++++++++++++----------------- src/commands/workspaces.ts | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/commands/buffers.ts b/src/commands/buffers.ts index ab683dc..b311e89 100644 --- a/src/commands/buffers.ts +++ b/src/commands/buffers.ts @@ -37,7 +37,7 @@ export async function apply_changes_to_buffer(path: string, controller: codemp.B })) { continue; } - else{ + else { controller.ack(event.version); } locks.delete(path); diff --git a/src/commands/client.ts b/src/commands/client.ts index 2679ae2..85aae72 100644 --- a/src/commands/client.ts +++ b/src/commands/client.ts @@ -118,24 +118,24 @@ export async function join(selected: vscode.TreeItem | undefined) { } }); - + workspaceState.workspace.callback(async function (controller: codemp.Workspace) { - while(true){ - if (workspaceState.workspace === null) { - controller.clearCallback(); - LOGGER.info("left workspace, stopping receiving events"); - return; - } - let event = await workspaceState.workspace.tryRecv(); - if (event === null) break; - if (event.type == "leave") { - mapping.colors_cache.get(event.value)?.clear() - mapping.colors_cache.delete(event.value); - } - if (event.type == "join") { - mapping.colors_cache.set(event.value, new mapping.UserDecoration(event.value)); - } - provider.refresh(); + while (true) { + if (workspaceState.workspace === null) { + controller.clearCallback(); + LOGGER.info("left workspace, stopping receiving events"); + return; + } + let event = await workspaceState.workspace.tryRecv(); + if (event === null) break; + if (event.type == "leave") { + mapping.colors_cache.get(event.value)?.clear() + mapping.colors_cache.delete(event.value); + } + if (event.type == "join") { + mapping.colors_cache.set(event.value, new mapping.UserDecoration(event.value)); + } + provider.refresh(); } }); diff --git a/src/commands/workspaces.ts b/src/commands/workspaces.ts index 3724ff1..fd52411 100644 --- a/src/commands/workspaces.ts +++ b/src/commands/workspaces.ts @@ -28,7 +28,7 @@ export async function jump(selected: vscode.TreeItem | undefined) { } if (!user) user = await vscode.window.showInputBox({ prompt: "username" }); if (!user) return; // user cancelled with ESC - workspaceState.follow=user; + workspaceState.follow = user; executeJump(user); }