@@ -91,7 +91,6 @@ export function taskToggle(event: ClickEvent) {
|
||||
export function previewTaskToggle(eventString: string) {
|
||||
const [eventName, pos] = JSON.parse(eventString);
|
||||
if (eventName === "task") {
|
||||
console.log("Gotta toggle a task at", pos);
|
||||
return taskToggleAtPos(+pos);
|
||||
}
|
||||
}
|
||||
@@ -107,9 +106,6 @@ async function toggleTaskMarker(node: ParseTree, moveToPos: number) {
|
||||
to: node.to,
|
||||
insert: changeTo,
|
||||
},
|
||||
selection: {
|
||||
anchor: moveToPos,
|
||||
},
|
||||
});
|
||||
|
||||
const parentWikiLinks = collectNodesMatching(
|
||||
@@ -147,7 +143,6 @@ export async function taskToggleAtPos(pos: number) {
|
||||
addParentPointers(mdTree);
|
||||
|
||||
const node = nodeAtPos(mdTree, pos);
|
||||
// console.log("Got this node", node?.type);
|
||||
if (node && node.type === "TaskMarker") {
|
||||
await toggleTaskMarker(node, pos);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,14 @@ syntax:
|
||||
styles:
|
||||
backgroundColor: "rgba(22,22,22,0.07)"
|
||||
functions:
|
||||
turnIntoTask:
|
||||
redirect: core.applyLineReplace
|
||||
slashCommand:
|
||||
name: task
|
||||
description: Turn into task
|
||||
match: "^(\\s*)[\\-\\*]?\\s*(\\[[ xX]\\])?\\s*"
|
||||
replace: "$1* [ ] "
|
||||
|
||||
indexTasks:
|
||||
path: "./task.ts:indexTasks"
|
||||
events:
|
||||
|
||||
Reference in New Issue
Block a user