diff --git a/Cargo.toml b/Cargo.toml index 943d9d3..4f00020 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ name = "codemp" crate-type = ["cdylib"] [dependencies] -codemp = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp.git", tag="v0.6.1"} -codemp-proto = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp-proto.git", tag = "v0.6.1" } +codemp = { git = "ssh://git@github.com/hexedtech/codemp.git", branch="glue"} +codemp-proto = { git = "ssh://git@github.com/hexedtech/codemp-proto.git", tag = "v0.6.1" } pyo3 = { version = "0.20", features = ["extension-module"] } pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] } serde = { version = "1.0.196", features = ["derive"] } diff --git a/plugin.py b/plugin.py index b736c71..9af73e4 100644 --- a/plugin.py +++ b/plugin.py @@ -198,7 +198,7 @@ class CodempJoinCommand(sublime_plugin.WindowCommand): ############################################################################# class CodempJoinWorkspaceCommand(sublime_plugin.WindowCommand): def run(self, workspace_id): - tm.dispatch(client.join_workspace(workspace_id, "sublime3")) + tm.dispatch(client.join_workspace(workspace_id)) def input_description(self): return "Join specific workspace" diff --git a/src/client.py b/src/client.py index 3763722..18fc39d 100644 --- a/src/client.py +++ b/src/client.py @@ -2,6 +2,7 @@ from __future__ import annotations from typing import Optional import sublime +import random import asyncio import tempfile import os @@ -125,7 +126,7 @@ class VirtualBuffer: region.begin(), region.end(), change.str ) ) - self.buffctl.send(region.begin(), region.end(), change.str) + self.buffctl.send(region.begin(), region.end()+len(change.str)-1, change.str) def send_cursor(self, vws: VirtualWorkspace): # TODO: only the last placed cursor/selection. @@ -340,10 +341,10 @@ class VirtualClient: status_log(f"Connected to '{server_host}' with user id: {id}") async def join_workspace( - self, workspace_id: str, user="sublime2", password="***REMOVED***" + self, workspace_id: str, user=f"user-{random.random()}", password="***REMOVED***" ) -> Optional[VirtualWorkspace]: try: - status_log(f"Logging into workspace: '{workspace_id}'") + status_log(f"Logging into workspace: '{workspace_id}' with user: {user}") await self.handle.login(user, password, workspace_id) except Exception as e: status_log(