diff --git a/src/commands/buffers.ts b/src/commands/buffers.ts index 4798a16..d37451d 100644 --- a/src/commands/buffers.ts +++ b/src/commands/buffers.ts @@ -36,7 +36,7 @@ export async function apply_changes_to_buffer(path: string, controller: codemp.B .replace(range, event.content) })) { vscode.window.showWarningMessage("Couldn't apply changes"); - await resync(path, workspace, editor, 100); + await resync(path, workspace, editor, 100); } locks.delete(path); @@ -244,7 +244,7 @@ export async function resync(buffer_name: string, workspace: codemp.Workspace, e console.log("attempts to sync", i); break; } - if (i == tries-1) { + if (i == tries - 1) { vscode.window.showErrorMessage(`Failed setting buffer content after ${tries} tries`); } } diff --git a/src/commands/client.ts b/src/commands/client.ts index e5dd8cd..e76f787 100644 --- a/src/commands/client.ts +++ b/src/commands/client.ts @@ -8,7 +8,7 @@ import { LOGGER, provider } from '../extension'; // TODO this "global state" should probably live elsewher but we need lo update it from these commands export let client: codemp.Client | null = null; export let workspace_list: string[] = []; -export let cursor_disposable : vscode.Disposable | null; +export let cursor_disposable: vscode.Disposable | null; export async function connect() { let config = vscode.workspace.getConfiguration('codemp'); @@ -59,7 +59,7 @@ export async function join(selected: vscode.TreeItem | undefined) { setWorkspace(await client.join_workspace(workspace_id)); if (!workspace) return; let controller = workspace.cursor(); - controller.callback(async function(controller: codemp.CursorController) { + controller.callback(async function (controller: codemp.CursorController) { while (true) { let event = await controller.try_recv(); if (workspace === null) { @@ -104,12 +104,12 @@ export async function join(selected: vscode.TreeItem | undefined) { once = false; } else { await controller.send({ - startRow: selection.anchor.line, - startCol: selection.anchor.character, - endRow: selection.active.line, + startRow: selection.anchor.line, + startCol: selection.anchor.character, + endRow: selection.active.line, endCol: selection.active.character, - buffer: buffer, - user: undefined, + buffer: buffer, + user: undefined, }); once = true; } diff --git a/src/extension.ts b/src/extension.ts index f4f0b2a..c34c608 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,7 +3,7 @@ import * as codemp from 'codemp'; import { client, connect, join, refresh, createWorkspace, inviteToWorkspace, listWorkspaces, leave } from './commands/client'; import { CodempTreeProvider } from './tree'; import * as mapping from './mapping'; -import { workspace, jump, listBuffers, createBuffer , deleteBuffer } from './commands/workspaces' +import { workspace, jump, listBuffers, createBuffer, deleteBuffer } from './commands/workspaces' import { attach, share, sync, apply_changes_to_buffer, detach } from './commands/buffers' export let provider = new CodempTreeProvider();