fix: yet another fix, now it should correctly delete lock
Some checks are pending
test / build-test (push) Waiting to run

This commit is contained in:
frelodev 2024-10-27 11:48:16 +01:00
parent 2aa513cc98
commit d85041bf4a

View file

@ -31,16 +31,13 @@ export async function apply_changes_to_buffer(path: string, controller: codemp.B
)
locks.set(path, event.change.content);
if (!await editor.edit(editBuilder => {
let success = await editor.edit(editBuilder => {
editBuilder
.replace(range, event.change.content)
})) {
continue;
}
else {
controller.ack(event.version);
}
});
if(success) controller.ack(event.version);
locks.delete(path);
if(!success) continue;
if (event.hash !== undefined) {
if (codemp.hash(editor.document.getText()) !== event.hash) {