1
0
silverbullet/plugins/core/link_navigate.ts
2022-02-24 17:24:49 +01:00

9 lines
298 B
TypeScript

import { syscall } from "./lib/syscall.ts";
export async function linkNavigate({ text }: { text: string }) {
let syntaxNode = await syscall("editor.getSyntaxNodeUnderCursor");
if (syntaxNode && syntaxNode.name === "WikiLinkPage") {
await syscall("editor.navigate", syntaxNode.text);
}
}