Changed attachment link behavior

This commit is contained in:
Zef Hemel
2022-09-06 14:36:06 +02:00
parent 03daf92ba4
commit 61d5f9d460
11 changed files with 70 additions and 6 deletions
+10
View File
@@ -1,5 +1,6 @@
import { SysCallMapping } from "@plugos/plugos/system";
import type { Editor } from "../editor";
import { AppCommand, CommandDef } from "../hooks/command";
import { version } from "../package.json";
export function systemSyscalls(editor: Editor): SysCallMapping {
@@ -23,6 +24,15 @@ export function systemSyscalls(editor: Editor): SysCallMapping {
"system.invokeCommand": async (ctx, name: string) => {
return editor.runCommandByName(name);
},
"system.listCommands": async (
ctx
): Promise<{ [key: string]: CommandDef }> => {
let allCommands: { [key: string]: CommandDef } = {};
for (let [cmd, def] of editor.commandHook.editorCommands) {
allCommands[cmd] = def.command;
}
return allCommands;
},
"system.getVersion": async () => {
return version;
},