1
0
silverbullet/plugins/core/link_navigate.ts

9 lines
298 B
TypeScript
Raw Normal View History

2022-02-24 16:24:49 +00:00
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);
}
}