Space sync now scheduled

This commit is contained in:
Zef Hemel
2023-08-15 20:24:02 +02:00
parent 7cce83b240
commit bd77f2932c
6 changed files with 14 additions and 10 deletions
+5
View File
@@ -166,6 +166,11 @@ export class SyncService {
this.filesScheduledForSync.delete(path);
}
async scheduleSpaceSync(): Promise<void> {
await this.noOngoingSync(5000);
await this.syncSpace();
}
start() {
this.syncSpace().catch(console.error);
-4
View File
@@ -184,10 +184,6 @@ export function editorSyscalls(editor: Client): SysCallMapping {
const cm = vimGetCm(editor.editorView)!;
return Vim.handleEx(cm, exCommand);
},
// Sync
"editor.syncSpace": () => {
return editor.syncService.syncSpace();
},
// Folding
"editor.fold": () => {
foldCode(editor.editorView);
+3
View File
@@ -12,5 +12,8 @@ export function syncSyscalls(editor: Client): SysCallMapping {
"sync.scheduleFileSync": (_ctx, path: string): Promise<void> => {
return editor.syncService.scheduleFileSync(path);
},
"sync.scheduleSpaceSync": () => {
return editor.syncService.scheduleSpaceSync();
},
};
}