mirror of
https://github.com/hexedtech/codemp-vscode.git
synced 2024-11-21 23:14:49 +01:00
fix: yet another fix, now it should correctly delete lock
Some checks are pending
test / build-test (push) Waiting to run
Some checks are pending
test / build-test (push) Waiting to run
This commit is contained in:
parent
2aa513cc98
commit
d85041bf4a
1 changed files with 4 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue