Changed attachment link behavior
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user